I had this working a different way but I'm trying to do it an easier way
if ($beds_result == 0)
{
$math_operator = '>=';
}
if ($beds_result > 0)
{
$math_operator = '=';
}
$query_Rslistings = "SELECT * FROM listings WHERE city = '$city_result' AND beds '$math_operator' '$beds_result' AND price BETWEEN '$min_price_result' AND '$max_price_result'";
I just want the one of the math operators entered into the query depending on what the user enters.I't worked a different way so I know It's only a syntax problem. Any ideas?
Check the manual that corresponds to your MySQL server version for the right syntax to use near ">=' '0'
if ($beds_result == 0)
{
$math_operator = '>=';
}
if ($beds_result > 0)
{
$math_operator = '=';
}
$query_Rslistings = "SELECT * FROM listings WHERE city = '$city_result' AND beds '$math_operator' '$beds_result' AND price BETWEEN '$min_price_result' AND '$max_price_result'";
I just want the one of the math operators entered into the query depending on what the user enters.I't worked a different way so I know It's only a syntax problem. Any ideas?
Check the manual that corresponds to your MySQL server version for the right syntax to use near ">=' '0'