An Error Was Encountered
Error Number: 1064
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 '-5, 5' at line 11
SELECT SQL_CALC_FOUND_ROWS g.*, p.id photo_id, p.photo_path, p.mature, ci.*, (select count(*) from group_members where group_id=g.id and status='ACTIVE') as group_member_count, (select count(*) from group_events where group_id=g.id) as event_count, (select count(*) from forums where group_id=g.id) as forum_count, NULL as distance, 0 as has_distance FROM (groups g) LEFT JOIN photos p ON g.photo_id=p.id LEFT JOIN club_info ci ON g.id=ci.group_id WHERE g.status = 'ACTIVE' AND g.hide_group = 'N' AND g.portal = 'models' AND g.id != 33 ORDER BY has_distance desc, distance asc,g.region asc, g.city asc LIMIT -5, 5