SELECT * FROM sh_advert WHERE sub= AND type="img" AND ifshow=1 ORDER BY orderby asc limit 0,1You 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 type="img" AND ifshow=1 ORDER BY orderby asc limit 0,1' at line 1