RE: [PHP-DB] mssql_fetch_array problem

From: Date: Tue, 19 Jun 2001 12:02:37 +0000
Subject: RE: [PHP-DB] mssql_fetch_array problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-9622@lists.php.net to get a copy of this message
Hi Jennifer, … I think that you want to display the Countryname in the DropDownBox, won't you ? Try this one (in your while-loop): if ($country == $myrow["countryid"]) { print "<option value=" . $myrow["countryid"] . " selected>" . $myrow["countryname"] . "</option>" . "\n"; } else { print "<option value=" . $myrow["countryid"] . ">" . $myrow["countryname"] . "</option>" . "\n"; } Hope this helps. If not, plz post what is going wrong. Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - _______________________________________________________________ Suchtreffer AG Bleicherstraße 20 D-78467 Konstanz Germany fon: +49-(0)7531-89207-17 fax: +49-(0)7531-89207-13 e-mail: mailto:mru@suchtreffer.de internet: http://www.suchtreffer.de _______________________________________________________________ > -----Original Message----- > From: Jennifer Arcino Demeterio [mailto:eper@tridel.net] > Sent: Tuesday, June 19, 2001 6:18 AM > To: php-db@lists.php.net > Subject: [PHP-DB] mssql_fetch_array problem > > > hello all, > > hope someone could help me .... > > it seems that the mssql_fetch_array did not work as it should > when the data > type to be fetch is an integer ... is there any work around for this? > > Below is my script ... > > $country_sql = "select countryname, countryid from TBL_COUNTRY"; > if ($country_query = mssql_query($country_sql)) { > while ($myrow = mssql_fetch_array($country_query)) > if ($country == $myrow["countryid"]) { > print "<option value=" . $myrow["countryid"] . > " selected>" . > $countryid . "</option>"; > } else { > print "<option value=" . $myrow["countryid"] . > ">" . > $countryid . "</option>"; > } > } > } > > > Thanks! > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.db (#9622) next »