Function.mysqli-num-rows
Aus PHP-Wiki
mysqli_num_rows
(PHP 5)
mysqli_num_rows -- Gets the number of rows in a resultInhaltsverzeichnis |
Description
Procedural style:
mixed mysqli_num_rows ( object result)</BR >
Object oriented style (property):
class mysqli {</BR >mixed num_rows
</BR >}
Returns the number of rows in the result set.
The use of mysqli_num_rows() depends on whether you use buffered or unbuffered result sets. In case you use unbuffered resultsets mysqli_num_rows() will not correct the correct number of rows until all the rows in the result have been retrieved.
Return values
Returns number of rows in the result set.
Anmerkung: If the number of rows is greater than maximal int value, the number will be returned as a string.
Siehe auch
function.mysqli-affected-rows function.mysqli-store-result function.mysqli-use-result function.mysqli-query
Example
Beispiel 1. Object oriented style
|
Beispiel 2. Procedural style
|
The above examples would produce the following output:
Result set has 239 rows. |