Ошибка в SQL
SELECT i.id,i.pid,i.module_id,i.title,i.l_width,i.l_height,i.b_width,i.b_height,x.fotogallery
FROM images i
LEFT JOIN articles x
ON x.id = i.pid
WHERE (i.pid= AND i.module_id=3)
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 'AND i.module_id=3)' at line 5