Is it possible to have a query like:
SELECT @threadIDvar = `threads`.`id` AS `threadID`, (SELECT `posts`.`timeDate` FROM `posts` WHERE `posts`.`threadID` = @threadIDvar) AS `postDate` FROM `threads` INNER JOIN `posts` ON `posts`.`threadID` = `threads`.`id` WHERE `threads`.`boardID` = 1
I tried this, but I get @threadID returned as NULL, and therefore postDate also as NULL.
How to get @threadIDvar variable to populate with returned thread id?
source share