MySQL :: MySQL 8.0 C API Developer Guide :: 6.4.6 mysql_stmt_close() (original) (raw)
Description
Closes the prepared statement.mysql_stmt_close() also deallocates the statement handler pointed to bystmt
, which at that point becomes invalid and should no longer be used. For a failedmysql_stmt_close() call, do not call mysql_stmt_error(), or mysql_stmt_errno(), ormysql_stmt_sqlstate() to obtain error information becausemysql_stmt_close() makes the statement handler invalid. Callmysql_error(),mysql_errno(), ormysql_sqlstate() instead.
If the current statement has pending or unread results, this function cancels them so that the next query can be executed.