I am trying to write a page that will select info from a database dependent on one variable which will be sent using $_GET[‘car’]
I am unsure about how to work the $_GET[‘car’] into my SQL query line.
At the moment i have:-
$result = mysql_query("SELECT * FROM products WHERE ($_GET['car'])=1");
and i would use *http://www.address.com/nameofphpfile.php?car=e36coupe * to send the names of the desired column in the MySQL table.
I can get the page to work fine if i just use something like:-
$result = mysql_query("SELECT * FROM products WHERE e36coupe=1");
but id like to be able to use a dropdown menu to select the car model rather than have a seperate php page for each one.
Any help much appreciated
Bunji