Have some php code:
// Fetch PDO instance
$pdo = $this->conn->getPdo();
// Call procedure that checks is user credentials is ok
$stmt = $pdo->prepare('CALL Users_CheckLogin(:username, :password);');
$passw = md5($credentials['passw']);
$stmt->bindValue(':username', $credentials['username']);
$stmt->bindValue(':password', $passw);
// Execute procedure
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_CLASS, 'ArrayObject');
$stmt->closeCursor();
For some reasons this code doesn't work here and returns:
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
I also googled about this error and haven't found any fix for this. So perhaps someone here can explain me what the problem is? I don't have paralels queries, only my procedure, inside this procedure I executing additional queries so perhaps that a reason but then it is huge bug in pdo. This procedure call works in mysql manager and with mysqli also.