mysqlmulti-query

MySQL multiquery gives errors, need to save variable


I have a table where I need to do two selections. First I need to find OBJ where uunn = abc. Then I need to select where OBJ equals the first result but it doesn't work.

Example:

SELECT OBJ INTO @obj FROM wddt WHERE `uunn`='abc' AND `mqr`='ps';
SELECT mqr FROM wddt WHERE `OBJ` = @obj AND `uunn`='as';

My goal is to check if mqr has a certain content, and I will compare that content in my PHP script.


Solution

  • Multi_query was disabled on the server I was trying to use, just tested everything using XAMPP and works like a charm. I didn't know multi-query could be disabled.