Same name in this branch
  1. 5.x includes/database.pgsql.inc \db_num_rows()
  2. 5.x includes/database.mysqli.inc \db_num_rows()
  3. 5.x includes/database.mysql.inc \db_num_rows()
Same name and namespace in other branches
  1. 4.6.x includes/database.pgsql.inc \db_num_rows()
  2. 4.6.x includes/database.mysql.inc \db_num_rows()
  3. 4.7.x includes/database.pgsql.inc \db_num_rows()
  4. 4.7.x includes/database.mysqli.inc \db_num_rows()
  5. 4.7.x includes/database.mysql.inc \db_num_rows()

Determine how many result rows were found by the preceding query.

Parameters

$result: A database query result resource, as returned from db_query().

Return value

The number of result rows.

Related topics

8 calls to db_num_rows()
db_table_exists in includes/database.mysql.inc
Check if a table exists.
db_table_exists in includes/database.mysqli.inc
Check if a table exists.
db_table_exists in includes/database.pgsql.inc
Check if a table exists.
flood_is_allowed in includes/common.inc
Check if the current visitor (hostname/IP) is allowed to proceed with the specified event. The user is allowed to proceed if he did not trigger the specified event more than $threshold times per hour.
node_type_delete_confirm in modules/node/content_types.inc
Menu callback; delete a single content type.

... See full list

File

includes/database.mysqli.inc, line 199
Database interface code for MySQL database servers using the mysqli client libraries. mysqli is included in PHP 5 by default and allows developers to use the advanced features of MySQL 4.1.x, 5.0.x and beyond.

Code

function db_num_rows($result) {
  if ($result) {
    return mysqli_num_rows($result);
  }
}