I'm trying to write my MySQL query, but I'm stuck on this - I have multiple queries from my php to the SQL database:
SET @var := SELECT MAX(first_column)
FROM table;
SELECT @var,
table.second_column
FROM table;
But it returns SQL error. When I use it in phpmyadmin, it works fine. I've googled and I saw people use "SET @var = MySQL query" only in stored procedures. Is it possible to use it the way I want?