faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

58 of 82 people (71%) answered Yes
Recently 6 of 10 people (60%) answered Yes


How can I make a HTML select box from the values in a database column?
How can prompt the user for their state?

Jun 13th, 1999 07:00
Nathan Wallace, Rod Kreisler

/*connect to your db*/
<form method="post" action="submit_page.php3">
<select name="state">
$result=dbquery("select state from yourtable");
  Print "<option>".$state;
<input type=submit name=submit>
Of course, you'll need to use the proper commands for the SQL
engine you're using.