PHP mysqli_more_results() Function
In this chapter you will learn:
- Definition for PHP mysqli_more_results() Function
- Syntax for PHP mysqli_more_results() Function
- Parameter for PHP mysqli_more_results() Function
- Return for PHP mysqli_more_results() Function
- Example - checks if there are more results from a multi query
Definition
The mysqli_more_results() function checks if there are more results from a multi query.
Syntax
Object oriented style
bool mysqli::more_results ( void )
Procedural style
bool mysqli_more_results ( mysqli $link )
Parameter
Parameter | Is Required | Description |
---|---|---|
connection | Required. | MySQL connection to use |
Return
It returns TRUE on success and FALSE on failure.
Example
Checks if there are more results from a multi query
<?php// j a va 2s. c o m
$con=mysqli_connect("localhost","my_user","my_password","my_db");
if (mysqli_connect_errno($con)){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql = "SELECT Lastname FROM Persons;SELECT Country FROM Customers";
// Execute multi query
mysqli_multi_query($con,$sql);
printf("%s\n",mysqli_more_results($con));
mysqli_close($con);
?>
Next chapter...
What you will learn in the next chapter:
- Definition for PHP mysqli_multi_query() Function
- Syntax for PHP mysqli_multi_query() Function
- Parameter for PHP mysqli_multi_query() Function
- Return for PHP mysqli_multi_query() Function
- Example - performs multiple queries against the database
- Example - Object oriented style
Home » PHP Tutorial » PHP MySQLi Functions