|
 |
maxdb_stmt_num_rows (PECL) maxdb_stmt_num_rows (no version information, might be only in CVS) stmt->num_rows -- Return the number of rows in statements result set DescriptionProcedural style : int maxdb_stmt_num_rows ( resource stmt ) Object oriented style (property): class stmt { int num_rows }
Returns the number of rows in the result set.
Return values
An integer representing the number of rows in result set.
ExampleПример 1. Object oriented style
<?php
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
if (maxdb_connect_errno()) {
printf("Connect failed: %s\n", maxdb_connect_error());
exit();
}
$query = "SELECT zip, name FROM hotel.city ORDER BY name";
if ($stmt = $maxdb->prepare($query)) {
$stmt->execute();
$stmt->store_result();
printf("Number of rows: %d.\n", $stmt->num_rows);
$stmt->close();
}
$maxdb->close();
?>
|
|
Пример 2. Procedural style
<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
if (maxdb_connect_errno()) {
printf("Connect failed: %s\n", maxdb_connect_error());
exit();
}
$query = "SELECT zip, name FROM hotel.city ORDER BY name";
if ($stmt = maxdb_prepare($link, $query)) {
maxdb_stmt_execute($stmt);
maxdb_stmt_store_result($stmt);
printf("Number of rows: %d.\n", maxdb_stmt_num_rows($stmt));
maxdb_stmt_close($stmt);
}
maxdb_close($link);
?>
|
|
The above examples would produce the following output:
maxdb_stmt_num_rows
There are no user contributed notes for this page.
| |