> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_errno.md).

# mysql\_stmt\_errno

## Syntax

```c
unsigned int mysql_stmt_errno(MYSQL_STMT * stmt);
```

## Parameter

* `stmt` - a statement handle, which was previously allocated by [mysql\_stmt\_init()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_init.md).

## Description

Returns the [error code](/docs/server/reference/error-codes.md) for the most recently invoked statement function that can succeed or fail.

## Return Value

Returns error code. A zero value means that no error occurred.

{% hint style="info" %}
Client error messages are listed in `errmsg.h` header file, server error messages are listed in `mysqld_error.h` header file of the server source distribution.
{% endhint %}

## See Also

* [mysql\_stmt\_error()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_error.md),
* [mysql\_stmt\_sqlstate()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_sqlstate.md)

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