I am making a database for equipment with two dropdown menus and the second choice will gather information from the sql data base based on the user’s selection in the second drop down.
My issue is that once the user hits “submit” I want to retrieve additional info on the selection from the data base. I believe I am using the correct method when calling the database, what I BELIEVE that problem might be is storing the selection by the user into a variable and/or the correct one to reference the corresponding row in the database. Here is my code in the portion where I need to call for the data.
I am unsure if I am storing the user’s selection correctly to reference the database.
//below code is in if(!isset) function
$result1=mysql_query(“Select Equip_Id
FROM maint_equip
Where Dept
=$dept”);
mysql_close():
print"Chose the equipment to be viewed";
print"
select name=equip Style=font-size :16pt>";
print" OPTION value=’ '>";
while($line=mysql_fetch_array($result1))
{
foreach ($line as $value)
{ print"<OPTION value= $value
“;
print”>$value";
}
} print"")
?
Click submit to post your entry: