Splitting number of records into groups?
<p>I have a large number of records in the CSV file.</p>

<p>I am trying to implement multiple Insert into single query but I need to workout how many single query I need base on Total records.  </p>

<p>For example:</p>

<pre><code>$totalRecord = 1620;
</code></pre>

<p>So I need 17 queries. 16 query will have 100 Insert records and 17th query will have 20 records.</p>

<p>The number of <code>$totalRecord</code> can be anything between 1 to 500,00</p>

<p>How to work this out?</p>

<p>Eg:</p>

<pre><code>Query 1:
INSERT INTO [table] 
( [field1], [field2], [field3] ) VALUES 
( '[value1.1]', '[value1.2]', '[value1.3]' ), 
( '[value2.1]', '[value2.2]', '[value2.3]' ), 
( '[value3.1]', '[value3.2]', '[value3.3]' ),

Query 2: 
INSERT INTO [table] 
( [field1], [field2], [field3] ) VALUES 
( '[value1.1]', '[value1.2]', '[value1.3]' ), 
( '[value2.1]', '[value2.2]', '[value2.3]' ), 
( '[value3.1]', '[value3.2]', '[value3.3]' ),
</code></pre>
