SELECT ad_id as id,ad_title as title,created_at ,CONCAT('online_ad_detail.php?id=',ad_id) as link FROM ad_tbl
where ad_type='1' and m_id = order by ad_id desc LIMIT 0,20;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 'order by ad_id desc LIMIT 0,20' at line 2