Hey everyone,
I have table with about 20 columns in it. It has a lot of misc info, but I would like to take out a certain part and put it into a drop down box (specifically the firstn lastn and cid)
Here is my code:
//Query
$sql = "SELECT * FROM jos_roster";
$result = mysql_query($sql, $con) or die("There was an error with your query: $sql" . "<HR><BR>" . mysql_error());
//form
echo '<FORM name = "editroster" action = "editroster.php" method = "post">
<Label> Controller </Label> <select name = "controllername">';
//populates the drop down box
while ($row = mysql_fetch_array($result))
{
$name = $row['cid'] . $row['lastn'] . $row['fname'];
echo "<option value = " . $row['cid'] . ">";
echo $name;
echo "</option>";
}
echo '</select>';
echo '</FORM>';
There isn't any errors with the code, however, it doesn't display anything in the drop down box. Thanks for any help.