Jump to content


Photo

select box problam please help


  • Please log in to reply
4 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 15 April 2006 - 12:10 PM


my select box wont show please help cheers


<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>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 15 April 2006 - 12:14 PM

Move the select closing tag ahead of the submit input and close the option tags.
<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>

Legend has it that reading the manual never killed anyone.
My site

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 15 April 2006 - 12:19 PM

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.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 15 April 2006 - 12:31 PM

Assuming both these variables exist in the database and that the db contains data, what does the generated html look like if you use this:
echo "<OPTION VALUE='". $record['fname']. "'>". $record['name']. "</option>";

Legend has it that reading the manual never killed anyone.
My site

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 15 April 2006 - 12:43 PM



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--]
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users