Syntax error, unexpected token ), near to ' AND ap_status = 0 AND ap_public = 1 ORDER BY ap_date DESC', when parsing: SELECT AlbumPhotos.* FROM AlbumPhotos WHERE AlbumPhotos.pa_id IN () AND ap_status = 0 AND ap_public = 1 ORDER BY ap_date DESC (151)