select * from io_songs where 1 =1 and status='1' and last_months_song='0' and song_id= order by song_id 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 song_id' at line 1