select c.*, r.url from lms_content as c LEFT JOIN lms_router as r ON (c.id = r.cid) WHERE c.type='record' AND c.cat='Front slider' ORDER BY weight, posted desc LIMIT ? failed.Array ( [0] => 5 ) Array ( [0] => %d ) 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 ''5'' at line 1