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); ?> Quote 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? Quote 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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/137401-solved-populate-select-list/#findComment-717966 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.