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 , t.t_name, t.t_summary FROM package p LEFT JOIN package_type t ON p.package_type = t.t_id p.package_type = 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_type = ORDER BY p.date DESC' at line 19