Warning: mysqli_stmt::close() [mysqli-stmt.close]: invalid object or resource mysqli_stmt… why?

拟墨画扇 提交于 2019-12-11 06:47:01

问题


for learning purposes, why does php cries about the following code and gives the following warning:

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

回答1:


From the mysqli::stmt_init documentation:

Any subsequent calls to any mysqli_stmt function will fail until mysqli_stmt_prepare() was called.



来源:https://stackoverflow.com/questions/7297640/warning-mysqli-stmtclose-mysqli-stmt-close-invalid-object-or-resource-my

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!