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 'WHERE ip_00 != '10.0.0.111' AND ip_00 != '93.91.50.163' GROUP BY ip_00' at line 2