title: mysqli_multi_query(); numerous submissions
body: <p>I have a PHP script that prepares 3 different SQL submissions. The SQL is valid for all of them. If I swap the order of the IF statements below, they all work. If the <code>$ratesSQL</code> is first then both 1) and 2) work. If either of the other two are first, then only 1) works.</p>
  
  <p><strong>The SQL:</strong></p>
  
  <pre><code>$sqlRates = "
  LOAD XML LOCAL INFILE '/xx/yy/zz/example.xml'
  REPLACE
  INTO TABLE rates
  ROWS IDENTIFIED BY '&lt;row&gt;'";
  </code></pre>
  
  <p>Both <code>$vixSQL</code> and <code>$aaaSQL</code> are a lot of <code>REPLACE INTO</code> statements. Example:</p>
  
  <pre><code>REPLACE INTO aaa (date,value) VALUES ('2016-01-29','4.05'); REPLACE INTO aaa (date,value) VALUES ('2016-01-28','4.07');
  </code></pre>
  
  <p><strong>The IF statements:</strong></p>
  
  <p>1) Successful submission with the below. $ratesSQL is approximately 300 rows of data.</p>
  
  <pre><code>if (mysqli_multi_query($dbc, $ratesSQL)) {
      echo "&lt;h3&gt;Rates Load Successful&lt;/h3&gt;&lt;br&gt;";
  } else {
      echo "&lt;h3&gt;Rates Load Error&lt;/h3&gt;&lt;br&gt;";
  }
  </code></pre>
  
  <p>2) Successful submission. ~8000 rows of data.</p>
  
  <pre><code>if (mysqli_multi_query($dbc, $vixSQL)) {
      echo "&lt;h3&gt;VIX Load Successful&lt;/h3&gt;&lt;br&gt;";
  } else {
      echo "&lt;h3&gt;VIX Load Error&lt;/h3&gt;&lt;br&gt;";
  }
  </code></pre>
  
  <p>3) Failed Submission, ~8000 rows of data</p>
  
  <pre><code>if (mysqli_multi_query($dbc, $aaaSQL)) {
      echo "&lt;h3&gt;AAA Load Successful&lt;/h3&gt;&lt;br&gt;";
  } else {
      echo "&lt;h3&gt;AAA Load Error&lt;/h3&gt;&lt;br&gt;";
  }
  </code></pre>
  
  <p>The <code>$ratesSQL</code> submission is only about 300 rows of data whilst the other two are about 8000. Is it this data quantity that is causing me issues? Any suggestions for getting round it?</p>
  
  <p>COMBINING QUERIES PER ANSWER BELOW ALLOWS ME TO GET AROUND THIS. STILL PUZZLING AS TO WHY SEPARATE QUERIES FAILED. ANY FURTHER INFO WOULD BE APPRECIATED</p>