Oracle 5.0 Reference Manual page 2311

Table of Contents

Advertisement

Retrieves the number of rows from a result set. This command is only valid for statements like SELECT
or SHOW that return an actual result set. To retrieve the number of rows affected by a INSERT,
UPDATE, REPLACE or DELETE query, use mysql_affected_rows.
Parameters
result
Return Values
The number of rows in a result set on success or
Examples
Example 20.65.
<?php
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);
$result = mysql_query("SELECT * FROM table1", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows\n";
?>
Notes
See Also
mysql_affected_rows
mysql_connect
mysql_data_seek
mysql_select_db
mysql_query
20.7.2.5.38.
mysql_pconnect
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysql_pconnect
Open a persistent connection to a MySQL server
Original MySQL API (Mysql)
The result resource that is being evaluated. This result comes from
a call to mysql_query.
example
mysql_num_rows
Note
If you use mysql_unbuffered_query,
correct value until all the rows in the result set have been retrieved.
Note
For backward compatibility, the following deprecated alias may be used:
mysql_numrows
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
MySQLi
on failure.
FALSE
mysql_num_rows
or
PDO_MySQL
extension should be used. See
2291
will not return the

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents