1064 You have an error in your SQL syntax; - shows on my site

I was working on my new Joomla site, changed some of the sessions appearing, then a syntax error appeared on the main page and changed the whole site design. I tried to undo all the changes I made and the error is still there message I received

1064 You have an error in your SQL syntax; check the manual that matches your MySQL server version for the correct syntax to use near ') AND c.access_view IN (0,1,1,5) AND c.restriction_18 = 0 ORDER BY i.date_start D' on line 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

      

Can anyone help me figure out where I can solve this problem?

Thanks everyone,

+3


source to share


1 answer


The problem is with the assertion AND i.type_id IN ()

.



Function

IN()

cannot get empty. You have to check the php code that makes the request and add confirmation to the variable to add the statement only if it is not empty.

+1


source







All Articles