Jump to content

[SOLVED] Populate Select List


Clinton

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.