mssql_fetch_array problem

From: Date: Wed, 20 Jun 2001 05:17:23 +0000
Subject: mssql_fetch_array problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-9643@lists.php.net to get a copy of this message
Thanks for all your answers, but, they still seem not to work. In my query, the value of countryname is retrieved as expected but the value of countryid is not. There seems to be no value retrieved for countryid. I am using PHP4 on IIS4 on an NT machine with SQL Server 7 as the database. "countryname" is of type varchar while "countryid" is type int, indentity, auto_increment. I tried listing them by printing the resultset but countryid still does not have any value. This could be a quirk that some of you experienced and I sure would like to hear how you overcame this. Thanks. I am posting again the code snippet below: <? $country_sql = "select countryname, countryid from TBL_COUNTRY"; if ($country_query = mssql_query($country_sql)) { while ($myrow = mssql_fetch_array($country_query)) { $countryid = $myrow["countryid"]; $countryname = $myrow["countryname"]; print "countryid is " . $countryid . " ,countryname is " . $countryname . "<br>"; } } ?>

« previous php.db (#9643) next »