Jennifer,
Try this code..I am using the same stuff as you with the exception of mysql instead of 
sql..but it may still work:
<?
    $country_sql = "select countryname co_name_val, countryid co_id_val from 
TBL_COUNTRY";
    if ($country_query = mssql_query($country_sql)) {
       while ($myrow = mssql_fetch_array($country_query)) {
     $countryid = $myrow["co_id_val"];
     $countryname = $myrow["co_name_val"];
     print "countryid is " . $countryid . " ,countryname is " .
$countryname . "<br>";
     }
    }
    ?>
It's kind of a "save as" type of statment but it works for me! I've had no problems 
with that sql statement.
Angie

>>> "Jennifer Arcino Demeterio" <[EMAIL PROTECTED]> 06/20/01 12:17AM >>>
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>";
     }
    }
    ?>




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 
To contact the list administrators, e-mail: [EMAIL PROTECTED] 



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to