title: INSERT 6000 Rows - best practice
body: <p>I have a PHP script that calls an API method that can easily return 6k+ results.</p>
  
  <p>I use PEAR DB_DataObject to write each row in a foreach loop to the DB.</p>
  
  <p>The above script is batch processing 20 users at a time - and although some will only have a few results from the API others will have more. Worst case is that all have 1000's of results.</p>
  
  <p>The loop to call the API seems to be ok, batches of 20 every 5 minutes works fine. My only concern is 1000's of mysql INSERTs for each user (with a long pause between each user for fresh API calls)</p>
  
  <p>Is there a good way to do this? Or am I doing it a good way?!</p>