RE: [PHP] html form question

From: Date: Thu, 26 Jul 2001 12:39:47 +0000
Subject: RE: [PHP] html form question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59727@lists.php.net to get a copy of this message
Thanks for that! I was just using the same structure as I found in a code sample somewhere. - seb -----Original Message----- From: Lenar [mailto:lenar@city.ee] Sent: 26 July 2001 13:16 To: php-general@lists.php.net Subject: Re: [PHP] html form question > Funny you should ask - just done it myself: Why you use mysql_result function? This can be done a bit simpler way (and more effective): <?php mysql_connect("db", $user, $password); $result = mysql_query( "SELECT eventName FROM $table"); while(list($event) = mysql_fetch_row($result)) echo "<option>$event</option>\n"; ?> Lenar > > <?php > $table="shoots"; > require ("connect.php4"); > $result=MYSQL_QUERY( "SELECT eventName FROM $table"); > $num_rows = mysql_num_rows($result); > > for ($i=0;$i<$num_rows;$i++) > { > echo "<option>"; > echo mysql_result($result,$i,"eventName"); > echo "</option>"; > } > > > MYSQL_CLOSE(); > ?> > > - seb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#59727) next »