title: PHP + mySQL when inserting many rows in loop to table my php hungs/freases/
body: <p>I have some strange problem with inserting rows in loop into mySQL table.
  Let me show you php code first that I use then I describe some statistic.</p>
  
  <p>I tend to think that it is some mySQL issue, but absolutely no idea what kind of. Max inserts in table per minute? (Can't be max row reached - planty of spase on disk)
  <pre> <code></p>
  
  <pre><code>echo " For character=" . $row[1];
  $xml = simplexml_load_file($api_url);
  $i=0;
  foreach ($xml-&gt;result-&gt;rowset-&gt;row as $value) {
          $newQuery = 'INSERT INTO '.$tableName.' (transactionDateTime, quantity, typeName, price, clientName, station, transactionType, seller) VALUES ("'.$value['transactionDateTime'].'",'.$value['quantity'].',"'.$value['typeName'].'","'.$value['price'].'","'.$value['clientName'].'","'.$value['stationName'].'","'.$value['transactionType'].'","'.$row[1].'")';
          $i++;
          if (!mysqli_query($conn, $newQuery))    {
                  die('Error while adding transaction record: ' . mysqli_error($conn));
          } // if END
  } // foreach END
  echo " added records=" . $i;
  </code></pre>
  
  <p></pre> </code>
  I have same data in XML that doesn't change. (XML has something like 1400+ rows that i would insert)</p>
  
  <ul>
  <li>It <strong>always</strong> inserts different amount of rows. Max amount it inserted was around 800+</li>
  <li>If I insert like 10sec delay into foreach loop at $i==400 it will add even less rows. And more delays - less rows.</li>
  <li>It never comes to that part of code where <code>mysqli_error($conn)</code></li>
  <li>It never reaches <code>echo " added records=" . $i;</code> part of the code.</li>
  </ul>
  
  <p>Since it alwasy stops on different recors I have to assume nothing wrong with INSERT query.
  Since it never reaches line after <strong>foreach</strong> loop <code>echo " added records=" . $i;</code> I also assume XML data wasn't processed by the end of it.
  If I use another sources of data (another character) where are less records in XML then this code works just fine.</p>
  
  <p>What could possibly be my problem? </p>