NEED HELP: select box repeat

From: Date: Mon, 17 Sep 2001 18:11:28 +0000
Subject: NEED HELP: select box repeat
Groups: php.dev 
Request: Send a blank email to php-dev+get-66130@lists.php.net to get a copy of this message
OK I am trying to write a script that will bring data out of a database into a select box. But what I need it to do is repeat 5 times or more depending on what it brings out. I can only get it to display one select box. Here is what I got so far: <?php require 'common.inc'; // Connect to the Database if (!($link = mysql_pconnect($DB_SERVER, $DB_LOGIN, $DB_PASSWORD))){ DisplayErrMsg(sprintf("internal error %d:%s\n", mysql_errno(), mysql_error())); exit() ; } ?> <head> <title>Flavors Select</title> </head> <body> <?php // Send the Query to the Server, to get the list of flavors if (!($result = mysql_db_query($DB,"SELECT * FROM extras WHERE name='$flav' ORDER BY 'choice'"))) { DisplayErrMsg(sprintf("internal error %d:%s\n", mysql_errno(), mysql_error())); return 0 ; } ?> <font face="verdana" size="2" color="#000000"> <form name="thisform" action="<?php $PHPSELF;?>" method="post"> <select> <option><?php echo $flav; ?> <?php while(($row = mysql_fetch_array($result))) { ?> <option value="<?php echo $row["choice"]; ?>"><?php echo $row["choice"]; ?> <?php } // End of while loop ?> </select> </form> </font> </body> <?php } ?> Please HELP _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

« previous php.dev (#66130) next »