MySQLi - Refresh



Syntax

int mysqli_refresh ( resource $link , int $options )

Definition and Usage

It used to refresh an SQL statement for execution.

Example

Try out following example −

<?php
   $servername = "localhost:3306";
   $username = "root";
   $password = "";
   $dbname = "TUTORIALS";
   $conn = new mysqli($servername, $username, $password, $dbname);
   
   if (!$conn->real_connect($servername, $username, $password, $dbname)) {
      die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
   }
   echo 'Success... ' . mysqli_get_host_info($conn) . "\n";
   mysqli_refresh($conn,MYSQLI_ASSOC);
   
   $conn->close();
?>

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

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