Mysql_search Function Issues

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:

<?php }else() //if(!isset) else section //connect and select database $result3=mysql_query("Select * FROM `maint_equip` Where `Equip_ID`=$equip"); $serial=mysql_result($result3, "0", "Serial_Number") //The first line above should select all data from the table based on the user's submission above. //The second line should take the data under the chart heading "Serial_Number" correct? Next I just display all the data in a table which I already have done. I am fairly new to php but I have picked it up quickly as I am very familar with other programming languages. I am just stuck with this issue, and any help would be apprciated.

Solved the problem awhile ago. Sometimes its better figuring it out yourself.

Sponsor our Newsletter | Privacy Policy | Terms of Service