Am Stranded and am requesting for help.
I am developing a car sales system but am unable to compine search criteria e.g the model of the car and price range; body, category and pricerange; model, transmission, fueltype and condition e.t.c
Someone Kindly help me.
The code below is able to search each individual feature on its own.


<?php
require("DbConnection.php");
$tbl="vehicle";
mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
mysql_select_db($db_name);
$body=$_POST['Body_Type'];
$category = $_POST['Category'];
$Model=$_POST['Model'];
$price=$_POST['price'];
$Transmission=$_POST['Transmission'];
$Fuel=$_POST['Fuel_Type'];
$Colour=$_POST['Colour'];
$Condition=$_POST['Condition'];
//default form values
$body_default="-select-";
$category_default ="-select-";
$Model_default="-select-";
$price_default="-select-";
$Transmission_default="-select-";
$Fuel_default="-select-";
$Colour_default="-select-";
$Condition_default="-select-";

$default_values = array($body_default, $category_default, $Model_default, $price_default, $Transmission_default, $Fuel_default, $Colour_default,$Condition_default );

$search = array($body, $category, $Model,$price, $Transmission, $Fuel, $Colour, $Condition);


foreach( $default_values as $default)
{
foreach ($search as $value)
{

$sql="SELECT * FROM $tbl where body='".$search[0]."' || category = '".$search[1]."' || model = '".$search[2]."' || pricerange = '".$search[3]."'
|| transmission = '".$search[4]."' || fueltype = '".$search[5]."' || color = '".$search[6]."' || carcondition = '".$search[7]."' && status='Available' ";
}

}

$result = mysql_query($sql);

$count=mysql_num_rows($result);


?>