I'm not sure why I keep getting this error. Image below....

Everytime I clear cache, it goes away but it comes back like 10 mins later. I keep getting this email...
Query:
SELECT p.*, if(`DateLastNav` > SUBDATE(NOW( ), INTERVAL 1 MINUTE ), 1, 0) AS `is_online`, UNIX_TIMESTAMP(p.`DateLastLogin`) AS 'TS_DateLastLogin',
UNIX_TIMESTAMP(p.`DateReg`) AS 'TS_DateReg' FROM `Profiles` AS p
where
(
( select ID from `sys_friend_list` where `ID` = p.`ID` AND `Profile` ='1355' AND `Check` = 1) > 0
OR
( select ID from `sys_friend_list` where `Profile` = p.`ID` AND `ID` ='1355' AND `Check` = 1) > 0
)
ORDER BY p.`Avatar` DESC
LIMIT 0,
Mysql error: 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 '' at line 13
Found error in the file '/var/www/main/inc/profiles.inc.php' at line 416.
Called 'db_res' function with erroneous argument #0.
Any ideas to fix this? I think it has to with something I did in phpMyAdmin... i'm not sure. :/
Thanks
Patrick
