i have a drop down list populated with values from database. What i am trying to achieve is assign a select statement to each value.

Populate menu code
<?php
require 'conn.php';
$filter=mysql_query("select distinct fuel_type from car");
while($row = mysql_fetch_array($filter)) {
$options .="<option>" . $row['fuel_type'] . "</option>";
$menu="<form id='filter' name='filter' method='post' action=''>
<p><label>Filter</label></p>
<select name='filter' id='filter'>
" . $options . "
</select>
</form>";
}
echo $menu;
?>
Now this menu will be used to filter out car listing and will be placed on the sidebar

How can i assign each value from the drop down list a different select statement like;
select * from car where fuel_type = (dropdown list value selected) without having to submit the form.
perhaps something like the following?
if($_GET["filter"] == 'Petrol'){
$query=mysql_query("select * from car where fuel_type = 'Petrol'");
header("Location: cars.php");
}
First, when you’re building your option tag, assign the value that you’d like to filter on in the SQL query to the value attribute:
Second, assign unique ID’s to your form and your select element. Then assign the form submit action to the select elements onchange event.
Now when you change the select option, the form will be submitted and the option value that is selected will be populated as that value of the select element #filter.
On the php page that your form posts to, check for the value of the select element with the id #filter to build the query.