Could anyone suggest why the greater than operator is being ignored in this MySQL query?
$sql = "SELECT *
FROM `items`
WHERE `short_description` LIKE '%".$term."%'
OR `description` LIKE '%".$term."%'
AND `quantity` > 0
ORDER BY year DESC, denomination ASC, description ASC $max";
I have a similar query on the same site that works
$sql = "SELECT *
FROM `items`
WHERE `category` = '".$cat_id."'
AND `quantity` > 0
ORDER BY year DESC, denomination ASC, description ASC;";
Everything works well, except the quantity comparison on the first query, Its has got me stumped.