MSSQL_NUM_ROWS(3) MSSQL_NUM_ROWS(3)
mssql_num_rows - Gets the number of rows in result
SYNOPSIS
int mssql_num_rows (resource $result)
DESCRIPTION
mssql_num_rows(3) returns the number of rows in a result set.
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, as an integer.
EXAMPLES
Example #1
mssql_num_rows(3) example
<?php
// Connect to MSSQL and select the database
$link = mssql_connect('KALLESPCSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Select all our records from a table
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
echo 'Total records in database: ' . mssql_num_rows($query);
// Clean up
mssql_free_result($query);
?>
SEE ALSO
mssql_query(3), mssql_fetch_row(3).
PHP Documentation Group MSSQL_NUM_ROWS(3)