Time : 10:52:09 SQLSTATE[42000]: Syntax error or access violation: 1064 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 'A.no DESC, A.reg_date DESC, A.no DESC LIMIT ?, ?' at line 13 Raw SQL : SELECT A.no, A.title, A.before_content, A.after_content, A.reg_date, A.etc1, B.attach AS attach1, B.attach_ori AS attach_ori1, B.mod_date AS mod_date1, C.attach AS attach2, C.attach_ori AS attach_ori2, C.mod_date AS mod_date2 FROM 2015_photo A LEFT JOIN 2015_attach B ON A.no = B.wno AND B.code = :Bcode AND B.seq = :Bseq LEFT JOIN 2015_attach C ON A.no = C.wno AND C.code = :Ccode AND C.seq = :Cseq WHERE A.no > :no AND A.d_show = :show AND A.del = :del AND A.reg_date < now() ORDER BY CASE A.no WHEN 6797 THEN 0 WHEN 6798 THEN 1 WHEN 6791 THEN 2 WHEN 6792 THEN 3 A.no DESC, A.reg_date DESC, A.no DESC LIMIT :startNum, :rowCount Time : 10:51:17 SQLSTATE[42000]: Syntax error or access violation: 1064 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 ' A.no DESC, A.reg_date DESC, A.no DESC LIMIT ?, ?' at line 12 Raw SQL : SELECT A.no, A.title, A.before_content, A.after_content, A.reg_date, A.etc1, B.attach AS attach1, B.attach_ori AS attach_ori1, B.mod_date AS mod_date1, C.attach AS attach2, C.attach_ori AS attach_ori2, C.mod_date AS mod_date2 FROM 2015_photo A LEFT JOIN 2015_attach B ON A.no = B.wno AND B.code = :Bcode AND B.seq = :Bseq LEFT JOIN 2015_attach C ON A.no = C.wno AND C.code = :Ccode AND C.seq = :Cseq WHERE A.no > :no AND A.d_show = :show AND A.del = :del AND A.reg_date < now() ORDER BY CASE A.no WHEN 6797 THEN 0 WHEN 6798 THEN 1 WHEN 6791 THEN 2 WHEN 6792 THEN 3, A.no DESC, A.reg_date DESC, A.no DESC LIMIT :startNum, :rowCount