出于学习目的,为什么php会对以下代码发出呐喊并发出以下警告:
Warning: mysqli_stmt::close() [mysqli-stmt.close]: invalid object or resource mysqli_stmt in C:\public_html\admin\disctrack.php on line 14
12 $conn = connect('w'); // connect to a database in write mode
13 $stmt = $conn->stmt_init(); // initialize a prepared statement
14 $stmt->close(); // close statement
答案 0 :(得分:2)
来自mysqli::stmt_init documentation:
在调用mysqli_stmt_prepare()之前,对任何mysqli_stmt函数的任何后续调用都将失败。