例
返回關於最近執行查詢的信息:
<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
{
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()函數返回關於最近執行查詢的信息。
此功能適用於以下的查詢類型:
- INSERT INTO ... SELECT ...
- INSERT INTO ... VALUES (...)
- LOAD DATA INFILE ...
- ALTER TABLE ...
- 更新中...
句法
mysqli_info( connection ) ;
參數 | 描述 |
---|---|
connection | 需要。 指定MySQL連接使用 |
技術細節
返回值: | 返回包含了最近執行的查詢其他信息字符串 |
---|---|
PHP版本: | 5+ |
<PHP庫MySQLi參考