-1
我想根据以下表格来过滤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')
我不知道为什么该查询不会筛选结果。即使用户输入任何一个字段,它也应该过滤结果。
显示您的输出 –
您应检查其值是否存在,然后根据这些值构建查询。 – billyonecan
查询给出的结果,但它并不过滤。请你的问题更清楚,这是目前的形式,它仍然不知道你问了什么关于恕我直言。 – hakre