也许一组新的眼睛可以帮助我。我认为这个错误对应于AND OR语句,但我切换了一些东西,仍然收到了同样的错误。有人看到以下陈述有什么问题吗?谢谢。查询工作正常,没有类似的子句。
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '%castillo% OR p.city LIKE %castillo% OR p.country LIKE
%castillo% ) GROUP BY ima' at line 1
SELECT p.id, p.name, p.city, p.country, images.name as image,
MIN(images.position) as position FROM properties as p, property_images
as images WHERE p.id = \images.property_id AND p.is_active = 1
AND ( p.name LIKE %castillo% OR p.city LIKE %castillo% OR p.country
LIKE %castillo% ) GROUP BY images.property_id