受项目影响,您必须按类别和价格进行搜索:
我得到以下mysql代码:
$query = " SELECT * FROM filmi WHERE $id3 = '1' $orderby_query "

filmi是主表,
$id3 = '1'是类别的辅助表。
$orderby_query是按价格desc / asc的简单顺序

如何按价格范围搜索?在10到100之间?我不能使用WHERE seriq BETWEEN 50000 AND 1000000 ORDER by seriq asc,因为已经到了:(

有什么建议么?

最佳答案

尝试这个

   WHERE $id3 = '1'
   AND seriq BETWEEN 50000 AND 1000000
   ORDER by seriq asc


或那样

   WHERE $id3 = '1'
   HAVING seriq >= 50000 AND  seriq <= 1000000
   ORDER by seriq asc

10-04 17:24