Returns information about the most recently executed query:
<?php // Assume database username: root, password: 123456, database: CODERCTO $con=mysqli_connect("localhost","root","123456","CODERCTO"); if (mysqli_connect_errno($con)) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Execute query $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 the recently queried information echo mysqli_info($con); mysqli_close($con);?>
The mysqli_info() function returns information about the most recently executed query.
This function works on the following query types:
INSERT INTO...SELECT...
INSERT INTO...VALUES (...),(...),(...)
LOAD DATA INFILE ...
ALTER TABLE ...
UPDATE...
mysqli_info( connection ) ;
parameter | describe |
---|---|
connection | Required. Specifies the MySQL connection to use. |
Return value: | Returns a string containing additional information about the most recently executed query. |
---|---|
PHP version: | 5+ |