# MYSQL\_STMT

The `MYSQL_STMT` structure is a handle for a prepared statement. The handle will be allocated by [mysql\_stmt\_init()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_init.md) and released by [mysql\_stmt\_close()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_close.md).

* All members of `MYSQL_STMT` are private and not intended for application use.
* Multiple statement handles can be opened within the same connection.
* After a successful call to [mysql\_stmt\_prepare()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_prepare.md) a prepared statement will also allocate resources on the server.
* Closing the connection with [mysql\_close()](/docs/connectors/mariadb-connector-c/api-functions/mysql_close.md) invalidates the statements but doesn't free resources on the client.

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/connector-c-data-structures-and-definitions/mysql_stmt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
