Jump to content

Need Help With DB Related Form


refiking

Recommended Posts

I am trying to call the records from the db into a drop down box, but it only has one record int he dropdown box.  All the other records are present, but they appear after the form.  How can I fix this?  here is the code:

<form action="commish.php" method="post">
<select name="owner"><option><font color="silver">Select Owner</option>
<option><font color="silver">
<?
$sql9 = mysql_query("SELECT * FROM retab WHERE lid = '$lid' AND sid = '$sid' ORDER BY did DESC")or die(mysql_error());
while($row9 = mysql_fetch_array($sql9)){
$owner = $row9['name'];
echo $owner."<br>";?></option></select>
<?
}
?>

Link to comment
https://forums.phpfreaks.com/topic/99992-need-help-with-db-related-form/
Share on other sites

<form action="commish.php" method="post">
<select name="owner">
<option><font color="silver">Select Owner</font></option>
<?php
  $sql9 = mysql_query("SELECT * FROM retab WHERE lid = '$lid' AND sid = '$sid' ORDER BY did DESC")or die(mysql_error());
  while($row9 = mysql_fetch_array($sql9)){
    echo '<option><font color="silver">'.$row9['name'].'</font></option>';
  }
?>
</select>
</form>

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.