title: How to get all errors after calling to mysqli_multi_query?
body: <p>I'm using this code:</p>
  
  <pre><code>$mysqli = new mysqli(...);
  
  $sql = file_get_contents("my_sql_file.sql");
  $result = $mysqli-&gt;multi_query($sql);
  
  if (!$result)
    report_error(); //my function
  
  while ($mysqli-&gt;more_results()) {
    $result = $mysqli-&gt;next_result();
    if (!$result)
      report_error();
  }
  </code></pre>
  
  <p>However the 'while' loop in the code above turned out to be an infinite loop. Anything wrong?</p>