PHPmysql_num_rows () function definition and usage description definition and usage the number of rows in the result set returned by the mysql_num_rows () function. Syntax mysql_num_rows (data) parameter description: required for data. Result set. This result set is obtained from the call of mysql_query. Description: PHP mysql_num_rows () function definition and usage
Definition and usage
The number of rows in the returned result set by the mysql_num_rows () function.
Syntax
mysql_num_rows(data)
Parameter description:
Data is required. Result set. This result set is obtained from the call of mysql_query.
Description
Mysql_num_rows () returns the number of rows in the result set. This command is only valid for SELECT statements. To obtain the number of rows affected by INSERT, UPDATE, or DELETE queries, use mysql_affected_rows ().
Tips and comments
Note: If mysql_unbuffered_query () is used, the correct value can be returned until all rows in the result set are extracted.
Note: If you use the data results queried by the mysql_unbuffered_query () function, you cannot use the mysql_num_rows () function to obtain the number of records in the query result set.
Example
The output is similar:
3
Instance 2:
Use the mysql_num_rows () function to obtain the number of records in the result set.
Sorry, the information you want to query does not exist.";}Do {// do... while loop?>
The above is the detailed description of PHP mysql_num_rows () function definition and instance usage Display. For more information, see other related articles in the first PHP community!