A database error was encountered

Message:

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 '' at line 4

Error number:

1064

Query:

SELECT COUNT(1) AS `totalrows` FROM `ds_users_data_members` AS `p` INNER JOIN `ds_users` AS `u` ON `p`.`profile_id`=`u`.`user_id` WHERE `u`.`verified`=1 AND `u`.`active`=1 AND `u`.`group_id` IN (5,3,2) AND `u`.`type_id` IN (1) AND `p`.`data_location`=