User defined variable in PHPMyAdmin's console not recognized

17 Views Asked by At

I'm testing user defined variable directly in PHPMyAdmin's console.

I've observed that if I create:

SET @myVariable = 14;

I execute it, and then try to use it in another query during the same session:

SELECT * FROM tblstaff WHERE staffid = @myVariable;

I execute it too but then I receive an empty table.

Now if I execute the exact same queries but in one go, the table returned contains the right info I need.

This does not look like a normal behavior to me. I'm still in the same session so the user defined variable should be recognized.

Can someone tell me if this behavior is normal in PHPMyAdmin? When I look at Youtube videos in other environments than PHPMyAdmin it seems like people don't have problems executing queries one after another.

Thank you :)

0

There are 0 best solutions below