Jump to content


Photo

Could someone tell me why this code does not display the first record found


  • Please log in to reply
23 replies to this topic

#21 Duncan Disorderly

Duncan Disorderly
  • Members
  • PipPip
  • Member
  • 16 posts
  • LocationBirmingham UK

Posted 18 July 2006 - 08:09 PM

WF...I thought I was doing that with </select> 
Am I doing something wrong?

#22 willfitch

willfitch
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts
  • LocationNew Hope, PA

Posted 18 July 2006 - 08:11 PM

Yes!

You have to close out the first <select> then close out the entire set with </select>

Just like XML, if a container has containers, the tags have to surround those.
Zend Certified Engineer (ZEND001989)
www.willfitch.com

#23 Duncan Disorderly

Duncan Disorderly
  • Members
  • PipPip
  • Member
  • 16 posts
  • LocationBirmingham UK

Posted 18 July 2006 - 08:14 PM

Got it...now i understand.... yes the <select......... needed to be closed with >
thanks guys and I apologise for my stupidity.

<select id="CB_T" name="CB_T" style="font-family: Arial,Helvetica,Geneva,Sans-serif; font-size: 10px; color: rgb(255,102,51);">      <-----the missing bit!

#24 redarrow

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

Posted 18 July 2006 - 08:16 PM

heres even an  easer example to understand ok

<select name="name">
<?

$db=mysql_connect("localhost","xxx","xxx");
mysql_select_db("xxx",$db);

$query="SELECT * from xxx";
$result=mysql_query($query);

while($record=mysql_fetch_assoc($result)){

$name=$record['what_ever'];
?>
echo "<option value='<?echo $name; ?>'> <?echo $name; ?> </option>";


<?}?>

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