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 '2.04890966415E+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 = 3 ORDER BY N.date DESC LIMIT 2.04890966415E+19, 5