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 a.ID = s.IDAdver group by a.ID order by Vip DESC, ID DESC, DateTop DESC limi' at line 1