PHP Tutorial - PHP mysqli_more_results() Function






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

ParameterIs RequiredDescription
connectionRequired.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/*from   w w w  . java2 s . c om*/
$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);
?>