note 33283 added to function.mssql-fetch-batch
| From: | cassano at monroe dot net | Date: | Fri, 20 Jun 2003 18:44:52 +0000 |
| Subject: | note 33283 added to function.mssql-fetch-batch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50768@lists.php.net to get a copy of this message | ||
int mssql_fetch_batch ( int result)
Returns: The number of rows for this batch
This works with the php.ini option 'mssql.batchsize' to limit the number of rows that are
buffered in memory.
i.e.
// Batch 10000 records in the buffer at a time
ini_set('mssql.batchsize', 10000);
$resDb = mssql_connect(...);
$result = mssql_query('SELECT * FROM MYTABLE', $resDb);
$intNumRows = mssql_num_rows($result);
while ($intNumRows > 0)
{
while ($arrRow = mssql_fetch_assoc($result))
{
// Do stuff ...
}
$intNumRows = mssql_fetch_batch($result);
}
----
Manual Page -- http://www.php.net/manual/en/function.mssql-fetch-batch.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33283
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33283&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33283&report=yes