6.4.7 mysql_stmt_close()

bool
mysql_stmt_close(MYSQL_STMT *stmt)

Description

Closes the prepared statement. mysql_stmt_close() also deallocates the statement handler pointed to by stmt, which at that point becomes invalid and should no longer be used. For a failed mysql_stmt_close() call, do not call mysql_stmt_error(), or mysql_stmt_errno(), or mysql_stmt_sqlstate() to obtain error information because mysql_stmt_close() makes the statement handler invalid. Call mysql_error(), mysql_errno(), or mysql_sqlstate() instead.

If the current statement has pending or unread results, this function cancels them so that the next query can be executed.

Return Values

Zero for success. Nonzero if an error occurred.

Errors

Example

See the Example in Section 6.4.11, “mysql_stmt_execute()”.