# mysql\_store\_result

## Syntax

```c
MYSQL_RES * mysql_store_result(MYSQL * mysql);
```

* `mysql` - a mysql handle, which was previously allocated by [mysql\_init()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_init) or [mysql\_real\_connect()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_real_connect).

## Description

Returns a buffered result set from the last executed query.

{% hint style="info" %}
mysql\_store\_result() returns NULL in case an error occurred or if the query didn't return data (e.g. when executing an [INSERT](https://app.gitbook.com/s/SsmexDFPv2xG2OTyO5yV/reference/sql-statements/data-manipulation/inserting-loading-data/insert) or [UPDATE](https://app.gitbook.com/s/SsmexDFPv2xG2OTyO5yV/reference/sql-statements/data-manipulation/changing-deleting-data/update) query.

[mysql\_field\_count()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_field_count) indicates if there will be a result set available.

The memory allocated by `mysql_store_result()` needs to be released by calling the function [mysql\_free\_result()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_free_result).
{% endhint %}

## See also

* [mysql\_use\_result()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_use_result)
* [mysql\_real\_query()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_real_query)
* [mysql\_field\_count()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_field_count)

{% @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-functions/mysql_store_result.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.
