At the moment i have this query:
$qry = "SELECT platforms.PID
FROM user_profile
LEFT JOIN platforms
ON platforms.relaccount = user_profile.subkey
WHERE user_profile.UID = `".$data['id']."`";
$games = $this->db->select('main.APPID, games_other.name, games_other.logo')
->select('platforms.PID, platforms.name AS pname, platforms.logo AS plogo')
->select('('.$qry.') AS filt', null, FALSE)
->from('games_link AS main')
->join('games_platforms', 'games_platforms.APPID = main.APPID', 'left')
->join('platforms', 'platforms.PID = games_platforms.PID', 'left')
->join('games_other', 'games_other.APPID = main.GB_ID', 'left')
->like('games_other.name', $name)
->where('platforms.PID', 'filt')
->limit(15)
->get();
Where im trying to get games based on an input string but filtered by what platforms a user has, but it returns this error:
Unknown column 'Cf9nHvOlaaLzFRegX2Il' in 'where clause'
SELECT `main`.`APPID`, `games_other`.`name`, `games_other`.`logo`, `platforms`.`PID`, `platforms`.`name` AS pname, `platforms`.`logo` AS plogo, (SELECT platforms.PID FROM user_profile LEFT JOIN platforms ON platforms.reaccount = user_profile.subkey WHERE user_profile.UID = `Cf9nHvOlaaLzFRegX2Il`) AS filt FROM (`games_link` AS main) LEFT JOIN `games_platforms` ON `games_platforms`.`APPID` = `main`.`APPID` LEFT JOIN `platforms` ON `platforms`.`PID` = `games_platforms`.`PID` LEFT JOIN `games_other` ON `games_other`.`APPID` = `main`.`GB_ID` WHERE `platforms`.`PID` = 'filt' AND `games_other`.`name` LIKE '%a%' LIMIT 15
Filename: response/update.php
I have tried changing a few things around but nothing fixes this.
Also since I Havant been able to get there yet, would this work as a filter. The sub query will return multiple.