MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
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 'DESC ORDER BY refcount DESC LIMIT 0 ,5' at line 5
Query:
SELECT u.uid,u.username,u.usergroup,u.displaygroup,count(*) as refcount FROM mybb_users u LEFT JOIN mybb_users r ON (r.referrer = u.uid) WHERE r.referrer = u.uid GROUP BY r.referrer DESC ORDER BY refcount DESC LIMIT 0 ,5

If you're a visitor of this website, please wait a few minutes and try again. If this problem persists, please contact the site owner.

If you are the site owner, please check the MyBB Documentation for help resolving common issues, or get technical help on the MyBB Community Forums.