?
Solved

mssql, PHP and field names

Posted on 1999-10-28
9
Medium Priority
?
378 Views
Last Modified: 2012-05-04
We've worked a lot with PHP3/MySQL with pleasure. But now I have to write a PHP3 script for an NT box with mssql server on it. Translating from the MySQL scripts works out right for the most but with MySQL I was used to use the mysql_field_name() function a lot.
mssql_field_name() doesn't exist as a function.
I've seen mssql_field_seek() and mssql_fetch_field() but don't know how to use them, also couldn't find it in the PHP3 docs.
I can't play with these functions because the NT box is not at my place, can someone help please...?
0
Comment
Question by:FranX
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 4

Expert Comment

by:oubelkas
ID: 2165734
Have you solved it yet FranX? Try using mssql_field_seek() or mssql_fetch_field() after succesfully installing PHP for WinNT

J.
0
 
LVL 5

Expert Comment

by:aarie
ID: 2169343
I don't know how those two functions work either, as documentation is pretty vague... However i would like to know what the solution to this problem is...

Arjan.
0
 
LVL 2

Expert Comment

by:gravity
ID: 2171916
Quite why do you need to use the mysql_field() function ? I do a lot of database work using PHP and MySQL but I've never had the need to use it.
0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
LVL 9

Expert Comment

by:svs
ID: 2187948
FranX,

mssql_field_seek() and mssql_fetch_field() are desribed in http://www.php.net/manual/function.mssql-field-seek.php3 and http://www.php.net/manual/function.mssql-fetch-field.php3, respectively.  If that is not enough information, sorry; I have not used
PHP with MS SQL Server.
0
 

Expert Comment

by:MARKII
ID: 2199863
Pls use ftp to sumit your php3 code that can be write in any text editor.
then browse from internet.

You can use this code below as ex.
<?
mysql_connect(   "localhost",   "root",   "password");

mysql_select_db(   "databasename")  or  die(   "Error  opening database");

$result  =  mysql_query(   "select  Season1,rtl1,rtl2,rtl3,Season2,rtm1,rtm2,rtm3,Season3,rth1,rth2,rth3 from  db where Hotel_Name='name'");

    while  ($row  =  mysql_fetch_row($result))  {
               echo"<center><table border=1 width=600>";
               echo"<tr><td rowspan=2><center><b><font color=#0000A0>Period for Room</font></b></center></td><td rowspan=2><center><b><font color=#0000A0>Published
      Rate<br>Single / Twin</font></b></center></td><td colspan=2>
      <center><b><font color=#0000A0>Standard Room Single / Twin</font></b></center></td></tr><tr><td>
      <center><b><font color=#0000A0>HKD</font></b></center></td><td>
      <center><b><font color=#0000A0>USD</font></b></center></td></tr>";
  echo"<tr><td><b><font face=Arial color=#000000 size=2>$row[0]</font></b></td><td><center>$row[1]</center></td><td><center>$row[2]</center></td><td><center>$row[3]</center></td></tr>";
 echo"<tr><td><b><font face=Arial color=#000000 size=2>$row[4]</font></b></td><td><center>$row[5]</center></td><td><center>$row[6]</center></td><td><center>$row[7]</center></td></tr>";
echo"<tr><td><b><font face=Arial color=#000000 size=2>$row[8]</font></b></td><td><center>$row[9]</center></td><td><center>$row[10]</center></td><td><center>$row[11]</center></td></tr>";
 echo"</table></center>";
 echo"<center><table border=1 width=600>";
 echo"<tr><td><center>NB: Prices are fully inclusive service charge and government tax</center></td></tr>";
 echo"</table></center>";
  }
?>

0
 
LVL 4

Accepted Solution

by:
oubelkas earned 400 total points
ID: 2202469
First of all, FranX talks about mssql, so not mysql and FranX, you might try this link :

http://phpdb.linuxbox.com

Joseph
0
 

Author Comment

by:FranX
ID: 2202609
Of course as you understand I've already been to http://www.php.net/manual/function.mssql-field-seek.php3, I always RTFM!

Thank's Though
0
 

Author Comment

by:FranX
ID: 2202614
Yep,

Good explanation on this site,
Thanx
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question