PHP mysqli_info() 函數(shù)
PHP MySQLi 參考手冊
實例
返回有關(guān)最近執(zhí)行查詢的信息:
<?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() 函數(shù)返回有關(guān)最近執(zhí)行查詢的信息。
該函數(shù)作用于下列查詢類型:
- INSERT INTO...SELECT...
- INSERT INTO...VALUES (...),(...),(...)
- LOAD DATA INFILE ...
- ALTER TABLE ...
- UPDATE ...
語法
參數(shù) | 描述 |
connection | 必需。規(guī)定要使用的 MySQL 連接。 |
技術(shù)細(xì)節(jié)
返回值: | 返回一個字符串,包含有關(guān)最近執(zhí)行查詢的額外信息。 |
PHP 版本: | 5+ |
PHP MySQLi 參考手冊
更多建議: