I am getting a DB error all of the sudden. Happens when a visitor tries to view some profiles. Only some profiles are like this. Any ideas?
Database error in Geocaching Atlantic
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
INNER JOIN (SELECT IF( '18' = f.`ID` , f.`Profile` , f.`ID` ) AS `ID`
FROM `sys_friend_list` AS `f`
WHERE 1 AND (f.`Profile` = '18' OR f.`ID` = '18') AND `Check` = 1) AS `f` ON (`f`.`ID` = `p`.`ID`)
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 9
Found error in the file '/home/blog2504/public_html/geocachingatlantic.ca/inc/profiles.inc.php' at line 388.
Called 'db_res' function with erroneous argument #0.
