mssql_fetch_batch

(PHP 4 >= 4.0.4, PHP 5)

mssql_fetch_batch --  Returns the next batch of records

Description

int mssql_fetch_batch ( resource result_index )

警告

本函数暂无文档,仅有参数列表。


add a note add a note User Contributed Notes
cassano at monroe dot net
21-Jun-2003 04:44
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);
}