Jump to content

dropdown populated from mysql field


adzie

Recommended Posts

Something like this?

 

<?php

//Connect to db

$query = "SELECT name FROM names_tbl";
$result = mysql_query($query);

echo "<select name=\"names\">\n";
while($row = mysql_fetch_array($result))
echo "<option name=\"".$row['name']."\">".$row['name']."</option>\n";

?>

 

 

Orio.

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.