SELECT p.id, p.package_category, p.package_type, p.country, p.title, p.summary, p.description, p.image, p.image_name, p.date, p.duration, p.status, p.page_keywords , dc.cat_name, dc.cat_summary FROM package p LEFT JOIN package_category dc ON p.package_category = dc.cat_id p.package_category = ORDER BY p.date DESC - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'p.package_category = ORDER BY p.date DESC' at line 19