You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BETWEEN begin_ip AND end_ip UNION SELECT `city_id` FROM `net_city_ip` WHE' at line 8