SELECT imid FROM image_subject AS A LEFT JOIN image_class AS B ON B.id=A.classid LEFT JOIN system_user AS C ON C.uid=A.uid WHERE 1 AND A.classid= AND A.imid< ORDER BY A.visnum DESC,A.imid DESC LIMIT 1
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 A.imid< ORDER BY A.visnum DESC,A.imid DESC LIMIT 1' at line 4