filter table mysql 也使用多个列

filter table mysql using multiple colums also between

如何使用多个类别加入BETWEEN语句和AND语句?

SELECT * FROM quick_inquiry WHERE inquiry_time BETWEEN '$start' AND  '$end' AND
  inquiry_language LIKE '%$language%' AND
  service_country LIKE '%$country%' AND
  category LIKE '%$category%' AND
  replied LIKE '%$replied%'

试试这个:

SELECT * FROM quick_inquiry
WHERE (inquiry_time BETWEEN '$start' AND '$end')
AND inquiry_language LIKE '%$language%'
AND service_country LIKE '%$country%'
AND category LIKE '%$category%'
AND replied LIKE '%$replied%'

您也可以使用 >= 和 <=

SELECT * FROM quick_inquiry
WHERE inquiry_time >= '$start'
AND inquiry_time <= '$end'
AND inquiry_language LIKE '%$language%'
AND service_country LIKE '%$country%'
AND category LIKE '%$category%'
AND replied LIKE '%$replied%'