SELECT * from master_news where type_id= and submit_date<'' ORDER BY recommendflag DESC,submit_date DESC LIMIT 0,1

Failed: SQLSTATE[42000]: Syntax error or access violation: 1064 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 'and submit_date<'' ORDER BY recommendflag DESC,submit_date DESC LIMIT 0,1' at line 1

SELECT * from master_news where type_id= and submit_date>'' ORDER BY recommendflag,submit_date LIMIT 0,1

Failed: SQLSTATE[42000]: Syntax error or access violation: 1064 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 'and submit_date>'' ORDER BY recommendflag,submit_date LIMIT 0,1' at line 1