Posted by thehuby on 09/29/05 17:28
Something like this should suffice - assuming you are using MySQL
anyway.
HTH
Rick
www.e-connected.com
$conn = mysql_connect( "localhost", "<USERNAME>", "<PASSWORD>" );
mysql_select_db ( "dogs", $conn );
$sql = "SELECT * FROM dogs_tbl";
$rs = mysql_query( $sql, $connection );
$html = "<select name='dogname'>";
while($row = mysql_fetch_row($rs)) {
$dogname = $row['dogname']; //this assumes that the column name is
'dogname'
$html .= "<option value='" .$dogname. "'>" .$dogname. "</option>";
}
$html .= "</select>";
[Back to original message]
|