The following MySQL query: select `userID` as uID, (select `siteID` from `users` where `userID` = uID) as `sID`,