I have this lines of code,
$val = self::$db->select('*')->select('a.id')->select("CONCAT(user_profile.firstname,' ',user_profile.middlename,' ',user_profile.lastname) AS user_name")->from('a')->join('user_profile', 'po.user_id = user_profile.id')->get()->result();
In this query, It will select all data in the rows. There is a column that is selected, "modified_by". I would like to use that to get the corresponding user_profile.firstname.
I tried this lines of code but not working,
$val = self::$db->select('*')->select('a.id')->select('a.modified_by' as modifier)->select("CONCAT(user_profile.firstname,' ',user_profile.middlename,' ',user_profile.lastname) AS user_name")->select('user_profile.firstname where user_profile.id = modifier ')->from('a')->join('user_profile', 'po.user_id = user_profile.id')->get()->result();