Jump to content

select box problam please help


redarrow

Recommended Posts


my select box wont show please help cheers

[code]

<html>
<head>
<title>search2</title>
<body>
search me via search box
<form  method="post" action="search.php>
<SELECT NAME="name">
<?
$db=mysql_connect("localhost","xxx","xxx");
mysql_select_db("freedating", $db);
$query="select * from pro_membersu";
$result=mysql_query($query);
while($record=mysql_fetch_assoc($result)){
echo"<OPTION VALUE='".$record["fname"]."'>".$record[name];
}

?>
<input type="submit" value="submit">
</select>
</form>
</body>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/7474-select-box-problam-please-help/
Share on other sites

Move the select closing tag ahead of the submit input and close the option tags.
[code]<html>
<head>
<title>search2</title>
<body>
search me via search box
<form  method="post" action="search.php>
<SELECT NAME="name">
<?
$db=mysql_connect("localhost","xxx","xxx");
mysql_select_db("freedating", $db);
$query="select * from pro_membersu";
$result=mysql_query($query);
while($record=mysql_fetch_assoc($result)){
echo "<OPTION VALUE='".$record["fname"]."'>".$record[name]. "</option>";
}
echo "</select>";
?>
<input type="submit" value="submit">

</form>
</body>[/code]

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.