Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = 'localhost'; // Host name Normally 'LocalHost'
- $user = 'root'; // MySQL login username
- $pass = ''; // MySQL login password
- $database = 'test'; // Database name
- mysql_connect($host, $user, $pass);
- mysql_select_db($database);
- $sql="SELECT thing FROM dropdown";
- $result=mysql_query($sql);
- $options="";
- while ($row=mysql_fetch_array($result))
- {
- $thing=$row["thing"];
- $options.="<OPTION VALUE=\"" . $thing . "\">" . $thing;
- }
- ?>
- <SELECT NAME=thing>
- <OPTION VALUE=0>Choose
- <?=$options?>
- </SELECT>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement