MySQLi - More Result



Syntax

bool mysqli_more_results ( mysqli $link )

Definition and Usage

It used to check if there are any more query results from a multi query.

Example

Try out following example −

<?php
   $servername = "localhost:3306";
   $username = "root";
   $password = "";
   $dbname = "TUTORIALS";
   $conn = new mysqli($servername, $username, $password, $dbname);

   if ($conn->connect_error) {
      die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
      exit();
   } 
   if (!mysqli_query($conn, "SET a = 1")) {
      printf("Errorcode: %d\n", mysqli_error($conn));
   }
   echo 'Success... ' . mysqli_get_host_info($conn) . "\n";
   
   $thread_id = mysqli_thread_id($conn);
   mysqli_kill($conn, $thread_id);
   
   $sql = "CREATE TABLE tutorials_auto1 LIKE tutorials_auto";
   mysqli_query($conn,$sql);
   
   $sql1 = "INSERT INTO tutorials_auto1 SELECT * FROM tutorials_auto ORDER BY name LIMIT 2";
   mysqli_query($conn,$sql1);
   printf("%s\n",mysqli_more_results($conn));
   
   $conn->close();
?>

The sample output of the above code should be like this −

Errorcode: 0 Success... localhost:3306 via TCP/IP
mysqli_useful_functions.htm
Advertisements