MySQL :: MySQL 8.4 C API Developer Guide :: 5.4.53 mysql_num_rows() (original) (raw)
Description
Returns the number of rows in the result set.
The use of mysql_num_rows() depends on whether you usemysql_store_result() ormysql_use_result() to return the result set. If you usemysql_store_result(),mysql_num_rows() may be called immediately. If you usemysql_use_result(),mysql_num_rows() does not return the correct value until all the rows in the result set have been retrieved.
mysql_num_rows() is intended for use with statements that return a result set, such asSELECT. For statements such asINSERT,UPDATE, orDELETE, the number of affected rows can be obtained withmysql_affected_rows().
Return Values
The number of rows in the result set.