redarrow Posted April 15, 2006 Share Posted April 15, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/7474-select-box-problam-please-help/ Share on other sites More sharing options...
AndyB Posted April 15, 2006 Share Posted April 15, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/7474-select-box-problam-please-help/#findComment-27223 Share on other sites More sharing options...
redarrow Posted April 15, 2006 Author Share Posted April 15, 2006 still nothink andy cheers ok,The $record[name]; is suppose to echo the box out but dosent but if i use the fname at the end i get the results with no box wired.thank you. Quote Link to comment https://forums.phpfreaks.com/topic/7474-select-box-problam-please-help/#findComment-27224 Share on other sites More sharing options...
AndyB Posted April 15, 2006 Share Posted April 15, 2006 Assuming both these variables exist in the database and that the db contains data, what does the [b]generated html [/b]look like if you use this:[code]echo "<OPTION VALUE='". $record['fname']. "'>". $record['name']. "</option>";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/7474-select-box-problam-please-help/#findComment-27225 Share on other sites More sharing options...
redarrow Posted April 15, 2006 Author Share Posted April 15, 2006 sorry typo on the form i have left the " out cheers[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]soved[!--sizec--][/span][!--/sizec--] Quote Link to comment https://forums.phpfreaks.com/topic/7474-select-box-problam-please-help/#findComment-27227 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.