I have created a form which is as Follow:
[HTML]
<form action="fleet-of-car.php" method="post">
<br />SELECT A FORM TO SEE :
<select name="FORM">
<option value="ALL CARS"/>All Cars
<Option Value="CARS BY MANUFACTURER"/>CARS BY MANUFACTURER
<Option Value="CARS BY FUEL TYPE"/>CARS BY FUEL TYPE
</select>
<br />
<input type="submit" value="Show INFO" />
</form>
</select>
[/HTML]
Now what i am trying to achieve is as follow:
1: By submitting the first option in this case All cars, the form should connect to DB and run the query, which if i am not wrong is as follow:
[PHP]
<?php
//make a connection
mysql_connect("server", "user", "password");
mysql_select_db ('db', $connection);
//Run the Sql
$results = mysql_query("SELECT * FROM car
");
?>
[/PHP]
The question i have is, what happens if the user selcets option 2 or even 3? The query will be different since it will read from different Mysql table to get the result, but what is the script required for this type query.
I though by using IF(isset), i might get away with it but i am not too familiar with it and i have no idea even where to start, WHILE statement should do it but i am just getting more confused.
Any help would be great guys, and thx well in advance
keyvan