Easy Tutorial
❮ Pdostatement Bindparam Php Get ❯

PHP mysqli_info() Function

PHP MySQLi Reference Manual

Returns information about the most recently executed query:

<?php 
// Assume database username: root, password: 123456, database: tutorialpro 
$con = mysqli_connect("localhost", "root", "123456", "tutorialpro"); 
if (mysqli_connect_errno($con)) 
{ 
    echo "Failed to connect to MySQL: " . mysqli_connect_error(); 
} 

// Execute queries
$sql1 = "CREATE TABLE testwebsites LIKE websites";
mysqli_query($con, $sql1);
$sql2 = "INSERT INTO testwebsites SELECT * FROM websites ORDER BY alexa LIMIT 3";
mysqli_query($con, $sql2);

// Output information about the most recent query
echo mysqli_info($con); 

mysqli_close($con);
?>

Definition and Usage

The mysqli_info() function returns information about the most recently executed query.

This function works with the following query types:


Syntax

Parameter Description
connection Required. Specifies the MySQL connection to use.

Technical Details

Return Value: Returns a string containing additional information about the most recently executed query.
PHP Version: 5+
--- ---

❮ Pdostatement Bindparam Php Get ❯