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 'Max''' at line 1
Query:
SELECT additionalgroups FROM mybb_users where username = 'Maxwell 'Max''