SELECT a.`ad_id`, a.`ad_title`, a.`ad_slug`, e.`cat_slug`, s.`sub_cat_slug`, a.`ad_description`, a.`ad_price`, a.`state_id`, a.`region_id`, a.`city`, a.`create_date`, b.`order_id`, b.`order_status`, c.`ad_image` FROM `tbl_manage_ads` a LEFT JOIN `tbl_categories` e ON e.cat_id = a.cat_id LEFT JOIN `tbl_subcategories` s ON s.sub_cat_id = a.sub_cat_id LEFT JOIN `tbl_manage_ad_images` c ON c.ad_id = a.ad_id AND c.`status` = '1' LEFT JOIN `tbl_orders` b ON a.ad_id = b.ad_id LEFT JOIN `tbl_states` d ON a.state_id = d.state_id WHERE a.status = 1 AND a.active=1 AND a.user_id= GROUP BY a.ad_id ORDER BY a.create_date DESC , a.create_time DESC
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 'GROUP BY a.ad_id ORDER BY a.create_date DESC , a.create_time DESC' at line 26