PHP mysqli_info() Function

PHP mysqli_info() function returns returns information about the last query executed.

Syntax

string mysqli_info(connection);

mysqli_info() Function Parameter

ParameterDescription
Connection :Required parameter. The MySQL connection to be used.

mysqli_info() Function Return Value

Return Values :Returns a character string representing additional information about the most recently executed query.

mysqli_info() Function Example

<?php
$con = mysqli_get_charset("localhost","user","password","db");

if (mysqli_connect_errno())
{
	echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$insert_member_sql = "INSERT INTO members (id, username) VALUES('$id', '$username')";
mysqli_query($con, $insert_member_sql);

// Get info about the last query
echo mysqli_info($con);

mysqli_close($con);
?>