Time : 12:23:21 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 'addresstype in (351,350) order by addresstype desc limit 1' at line 1 Raw SQL : select addresstype from contact where PARTY=277and addresstype in (351,350) order by addresstype desc limit 1 Time : 09:09:40 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 '1' at line 1 Raw SQL : select DATE_FORMAT(DATEOFEDITIONS,'%Y-%m-%d') as DATEOFEDITIONS,MAGZINEEDITIONSID from magzineeditions where MAGZINEEDITIONSID<143limit 1