DATABASE ERROR:
SELECT
				CASE
				WHEN f.from_id = 0
				THEN f.to_id
				WHEN f.to_id = 0
				THEN f.from_id
				END AS id, u.nickname as nickname, u.login as login
                FROM cms_user_friends f
				LEFT JOIN cms_users u ON u.id = CASE WHEN f.from_id = 0 THEN f.to_id WHEN f.to_id = 0 THEN f.from_id END
				WHERE (from_id = 0 OR to_id = 0) AND is_accepted =1
Table 'galub209_rayrad2.cms_user_friends' doesn't exist