返回有关最近执行查询的信息:
<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// Perform queries
$sql1="CREATE TABLE testPersons LIKE Persons"
mysqli_query($con,$sql1);
$sql2="INSERT INTO testPersons SELECT * FROM Persons ORDER BY LastName LIMIT 10"
mysqli_query($con,$sql2);
// Print info about most recently executed query
echo mysqli_info($con);
mysqli_close($con);
?>
mysqli_info() 函数返回有关最近执行查询的信息。
该函数作用于下列查询类型:
mysqli_info(connection);
参数 | 描述 |
---|---|
connection | 必需。规定要使用的 MySQL 连接。 |
返回值: | 返回一个字符串,包含有关最近执行查询的额外信息。 |
---|---|
PHP 版本: | 5+ |