我想根据以下表格过滤mysql结果
www.dabndash.com/filter.php
我一直在尝试的过滤器的mysql代码是:
SELECT DISTINCT * FROM paintings
WHERE (price BETWEEN '$min_price' AND '$max_price')
AND (orientation = '$orientation1' OR orientation = '$orientation2' OR orientation = '$orientation3')
AND (size_diagonal BETWEEN '$size_min' AND '$size_max')
AND (primary_color = '$primary_color' AND secondary_color = '$secondary_color')
我不确定为什么查询没有过滤结果。即使用户输入了任何一个字段,它也应该过滤结果。