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 solution other than using buffered queries option. I have tried that as well but it doesn't work.
The error is: PDO Cannot execute queries while other unbuffered queries are active
The error is coming from the line where I am building the $result array.
foreach($phones as $phone)
{
$stmt = db::getInstance()->prepare("CALL phones(:phone)");
$stmt->bindParam(':phone', $phone, PDO::PARAM_INT, 10);
$stmt->execute();
$result[] = db::getInstance()->query("SELECT @phone;")->fetchAll(PDO::FETCH_ASSOC);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…