PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular

mysqli_num_rows

Tags: PHP 5.x PHP 7.x PHP 8.x

mysqli_num_rows — Gets the number of rows in a result.

Description

mysqli_num_rows(
    mysqli_result $result
): int|string
Returns the number of rows in the result set. The behaviour of mysqli_num_rows() depends on whether buffered or unbuffered result sets are being used. For unbuffered result sets, mysqli_num_rows() will not return the correct number of rows until all the rows in the result have been retrieved.

Parameters

A mysqli_result object returned by mysqli_query(), mysqli_store_result(), mysqli_use_result() or mysqli_stmt_get_result().

result
A mysqli_result object returned by mysqli_query(), mysqli_store_result(), mysqli_use_result() or mysqli_stmt_get_result().

Return Values

Returns number of rows in the result set.