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 '3.53902578354E+19, 5' at line 1 query: SELECT SQL_CALC_FOUND_ROWS N.id, N.title, N.body, N.img, C.title AS category, SC.title AS subcategory FROM news N INNER JOIN categories C ON C.id = N.id_category LEFT JOIN subcategories SC ON SC.id = N.id_subcategory WHERE N.id_category = 1 AND N.id_subcategory = 1 ORDER BY N.date DESC LIMIT 3.53902578354E+19, 5