I'm trying to get something that reads out of a database and then has a drop down menu for each piece it gets out of the data base i.e.
car1 color option box
car2 color option box
car3 color option box
car4 color option box
car5 color option box
where color option box is a drop down menu with different choices, with the eventual goal of updating the database with changes made. Right now I can't figure out why the drop boxes appear one line below the leader for the line, I also can't figure out why the extra drop box is being generated at the end.
Here is my code
<?php
$link = @mysql_connect('localhost', 'root', 'password') or
die("Could not connect to MySQL");
$db = @mysql_select_db('temp1',$link) or
die("Could not select database");
$query = "SELECT * FROM table1";
$result = @mysql_query($query,$link) or
die("Could not submit query");
$numrows = @mysql_num_rows($result);
for ($i=0; $i<$numrows; $i++) {
$jones = mysql_fetch_array($result);
echo ("Location: "."$jones[location]");
dropmenu();
}
;
function dropmenu()
{
?>
<form action="#" method="post">
<SELECT NAME="state" SIZE="1">
<OPTION VALUE="1">ACTIVE</OPTION>
<OPTION VALUE="2">BROKEN</OPTION>
<OPTION VALUE="3"">PLANNED</OPTION>
</SELECT>
<input type="submit" value="crazy stuff"/>
</form>
<?php
}
dropmenu();
?>