Clinton Posted December 17, 2008 Share Posted December 17, 2008 Can't figure out my error... Database is called project table is called cities column is called city if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("project", $con); $sql = "SELECT city FROM cities "."ORDER BY cities"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { extract($row); echo "<option value=$city>$city</option>"; } mysql_close($con); ?> Link to comment https://forums.phpfreaks.com/topic/137401-solved-populate-select-list/ Share on other sites More sharing options...
premiso Posted December 17, 2008 Share Posted December 17, 2008 Whats the error? Link to comment https://forums.phpfreaks.com/topic/137401-solved-populate-select-list/#findComment-717959 Share on other sites More sharing options...
.josh Posted December 17, 2008 Share Posted December 17, 2008 for one, you are ordering by your table name Link to comment https://forums.phpfreaks.com/topic/137401-solved-populate-select-list/#findComment-717962 Share on other sites More sharing options...
Clinton Posted December 17, 2008 Author Share Posted December 17, 2008 I'm a bonehead. That was it. :-\ Thank you. Link to comment https://forums.phpfreaks.com/topic/137401-solved-populate-select-list/#findComment-717966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.