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 'AND p.replyto = '0' AND t.closed NOT LIKE 'moved|%'' at line 5
Query:
SELECT t.*, u.username AS userusername, p.* FROM drummitup_threads t LEFT JOIN drummitup_users u ON (u.uid=t.uid) LEFT JOIN drummitup_posts p ON (p.tid=t.tid) WHERE u.uid= AND p.replyto = '0' AND t.closed NOT LIKE 'moved|%'