我正在研究我的新joomla网站改变了一些出现的坐位然后语法错误出现在主页面并更改了所有的网站设计我试图撤消我所做的所有更改并且错误仍然存在 我得到的信息
1064您的SQL语法有错误;检查手册 对应于您的MySQL服务器版本,以便使用正确的语法 '附近')和c.access_view IN(0,1,1,5)和c.restriction_18 = 0 ORDER BY i.date_start D'在第2行
SELECT i.*,c.id as c_id, c.name as c_name,c.alias as c_alias,c.icon_url as c_icon_url,
r.name as r_name, img.path as img_path, img.name as img_name, img.ext as img_ext,
img.caption as img_caption
FROM l0ucm_djcf_categories c, l0ucm_djcf_items i
LEFT JOIN l0ucm_djcf_regions r ON r.id=i.region_id
LEFT JOIN ( SELECT img.id, img.item_id, img.name, img.path, img.ext, img.ordering, img.caption
FROM (SELECT * FROM l0ucm_djcf_images WHERE type='item' ORDER BY ordering) img GROUP BY img.item_id ) AS img
ON img.item_id=i.id
WHERE i.date_exp > '2015-07-25 16:44:45' AND i.published = 1 AND c.published = 1
AND i.cat_id=c.id AND i.cat_id IN (9,10,11,12,13,15)
AND i.type_id IN () AND c.access_view IN (0,1,1,5) AND c.restriction_18=0
ORDER BY i.date_start DESC limit 9
任何人都可以帮我找出解决这个问题的方法吗?
谢谢大家,
答案 0 :(得分:1)
问题出在AND i.type_id IN ()
声明中。
IN()
函数无法获取空值。你应该检查创建查询的php代码,并在变量中添加一个验证,只有当它不为空时才添加它。