I know this has to be a simple fix and I partially understand why I am getting this error but don\'t know how to fix it. I\'ve looked over the docs but can\'t find a solutio
I just ran into this problem myself and the problem turned out to be the use of stacked queries. The above solution did not solve the problem.
We had this query running right before the one that triggered the error:
return $this->fquery('
SELECT @follow_id:=COALESCE(MAX(follow_id) + 1, 0) FROM sync_delete_value;
INSERT INTO sync_delete_value (...)
VALUES (%d, @follow_id, %d, "%s")',
$val1, $val2, $val3
);
Everything resumed as usual when I changed this into:
$followId = $this->fquery('
SELECT @follow_id:=COALESCE(MAX(follow_id) + 1, 0) FROM sync_delete_value'
);
return $this->fquery('
INSERT INTO sync_delete_value (...)
VALUES (%d, %d, %d, "%s")',
$val1, $followId, $val2, $val3
);
It's sorta pseudo-code but you get the point.