title: PDO Cannot execute queries while other unbuffered queries are active
body: <p>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.</p>
  
  <p>The error is: PDO Cannot execute queries while other unbuffered queries are active</p>
  
  <p>The error is coming from the line where I am building the $result array.</p>
  
  <pre><code>foreach($phones as $phone)
  {
      $stmt = db::getInstance()-&gt;prepare("CALL phones(:phone)");
      $stmt-&gt;bindParam(':phone', $phone, PDO::PARAM_INT, 10);
      $stmt-&gt;execute();
  
      $result[] = db::getInstance()-&gt;query("SELECT @phone;")-&gt;fetchAll(PDO::FETCH_ASSOC);
  }
  </code></pre>