SELECT a.con_id,a.menu_id,a.con_cat_id,a.con_is_pro,a.con_title,a.con_des,a.con_seo_title,a.con_seo_keywords,a.con_seo_des,a.con_post_date,a.con_up_date,a.con_state,a.con_cat_date,(select con_cat_name from bb_content_category where con_cat_id = a.con_cat_id ) as con_cat_name , b.con_id,b.new_title,b.new_con as con_des,b.new_author,b.new_from,b.new_pv from bb_content a join bb_con_news b on a.con_id = b.con_id where a.con_state = 1 and a.menu_id = 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 '' at line 2