# mysql\_info

## Syntax

```c
const char * mysql_info(MYSQL * mysql);
```

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

## Description

The `mysql_info()` function returns a string providing information about the last query executed. The nature of this string is provided below:

Table 1. Possible `mysql_info` return values

| Query type                                                                                                                                                | Example result string                        |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| [INSERT INTO...SELECT...](/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data.md)                                              | Records: 100 Duplicates: 0 Warnings: 0       |
| [INSERT INTO...VALUES (...),(...),(...)](/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data.md)                               | Records: 3 Duplicates: 0 Warnings: 0         |
| [LOAD DATA INFILE ...](/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/load-data-into-tables-or-index/load-data-infile.md) | Records: 1 Deleted: 0 Skipped: 0 Warnings: 0 |
| [ALTER TABLE ...](/docs/server/reference/sql-statements/data-definition/alter/alter-table.md)                                                             | Records: 3 Duplicates: 0 Warnings: 0         |
| [UPDATE ...](/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/update.md)                                                    | Rows matched: 40 Changed: 40 Warnings: 0     |

{% hint style="info" %}
Queries which do not fall into one of the preceding formats are not supported (e.g. [SELECT ...](/docs/server/reference/sql-statements/data-manipulation/selecting-data/select.md)). In these situations, `mysql_info()` will return an empty string.
{% endhint %}

## See also

* [mysql\_affected\_rows()](/docs/connectors/mariadb-connector-c/api-functions/mysql_affected_rows.md)
* [mysql\_warning\_count()](/docs/connectors/mariadb-connector-c/api-functions/mysql_warning_count.md)

{% @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_info.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.
