synchronize html-php comboBox with database

ALI BABA

New Member
I've some part of my php script :\[code\]<? $cn=mysql_connect("localhost","root") or die("Note: " . mysql_error()); $res=mysql_select_db("psi",$cn) or die("Note: " . mysql_error()); $sql = "select names from list;"; $res=mysql_query($sql) or die("Note: " . mysql_error());?><select name="namez" size=1><? while($ri = mysql_fetch_array($res)) { echo "<option value="http://stackoverflow.com/questions/14071807/.$ri."</option>"; }echo "</select> ";?>\[/code\]I want to make the comboBox has menu taken from "names" field through my database, but it still has no menu?
 
Back
Top