array(2) { [":error"]=> string(122) "ERROR: syntax error at or near "AND" LINE 4: WHERE pg.record_id = AND pg.module_id = 20 ^ " [":query"]=> string(265) "SELECT ph.*, pg.id AS id_g, pg.title AS title_g, pg.perex AS perex_g, pg.body AS body_g, pg.seo_url AS seo_url_g FROM "files" AS ph LEFT JOIN "fgalleries" AS pg ON (ph.gallery_id = pg.id) WHERE pg.record_id = AND pg.module_id = 20 ORDER BY ph.rank " } int(0) NULL