MSSQL_FETCH_BATCH(3) MSSQL_FETCH_BATCH(3)
mssql_fetch_batch - Returns the next batch of records
SYNOPSIS
int mssql_fetch_batch (resource $result)
DESCRIPTION
Returns the next batch of records.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
RETURN VALUES
Returns the number of rows in the returned batch.
EXAMPLES
Example #1
mssql_fetch_batch(3) example
<?php
// Connect to MSSQL and select the database
$link = mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php', $link);
// Send a query
$result = mssql_query('SELECT * FROM [php].[dbo].[people]', $link, 100);
$records = 10;
while ($records >= 0) {
while ($row = mssql_fetch_assoc($result)) {
// Do stuff ...
}
--$records;
}
if ($batchsize = mssql_fetch_batch($result)) {
// $batchsize is the number of records left
// in the result, but not shown above
}
?>
PHP Documentation Group MSSQL_FETCH_BATCH(3)