Example 20.170. Procedural style
<?php
/* Open a connection */
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, CountryCode FROM City ORDER BY Name LIMIT 20";
if ($stmt = mysqli_prepare($link, $query)) {
/* execute query */
mysqli_stmt_execute($stmt);
/* store result */
mysqli_stmt_store_result($stmt);
printf("Number of rows: %d.\n", mysqli_stmt_num_rows($stmt));
/* close statement */
mysqli_stmt_close($stmt);
}
/* close connection */
mysqli_close($link);
?>
The above examples will output:
Number of rows: 20.
See Also
mysqli_stmt_affected_rows
mysqli_prepare
mysqli_stmt_store_result
20.7.3.10.21. mysqli_stmt::$param_count,
Copyright 1997-2012 the PHP Documentation Group. [2230]
•
mysqli_stmt::$param_count
mysqli_stmt_param_count
Returns the number of parameter for the given statement
Description
Object oriented style
int
mysqli_stmt->param_count ;
Procedural style
MySQL Improved Extension (Mysqli)
mysqli_stmt_param_count
2464
Need help?
Do you have a question about the 5.0 and is the answer not in the manual?
Questions and answers