I have input boxes that get 2 values $form_lowestPrice & $form_highestPrice
I also have an average price in the database which will display on my results page $form_averagePrice .
I need to check that if a $form_lowestPrice is blank then it will select an $form_averagePrice from the database no higher than $form_highestPrice
also that if $form_highestPrice is blank then it will select an $form_averagePrice from the database no lower than the $form_lowestPrice
Im not sure to do this when I am defining my SQL query to retrieve the records or after that.
PLEASE HELP
My 2 sections of that particular code
-- defining sql --
if ($form_lowestPrice != "" || $form_highestPrice != "")
{
$query .= "AND restaurants.restaurant_price = '$form_averagePrice' ";
}
--displaying results
$form_averagePrice = $row['form_averagePrice'];
if ($form_averagePrice >= $form_lowestPrice)
{
i dont know!
}
I also have an average price in the database which will display on my results page $form_averagePrice .
I need to check that if a $form_lowestPrice is blank then it will select an $form_averagePrice from the database no higher than $form_highestPrice
also that if $form_highestPrice is blank then it will select an $form_averagePrice from the database no lower than the $form_lowestPrice
Im not sure to do this when I am defining my SQL query to retrieve the records or after that.
PLEASE HELP
My 2 sections of that particular code
-- defining sql --
if ($form_lowestPrice != "" || $form_highestPrice != "")
{
$query .= "AND restaurants.restaurant_price = '$form_averagePrice' ";
}
--displaying results
$form_averagePrice = $row['form_averagePrice'];
if ($form_averagePrice >= $form_lowestPrice)
{
i dont know!
}