> 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-functions/mariadb_connection.md).

# mariadb\_connection

## Syntax

```bnf
#include <mysql.h>

my_bool mariadb_connection(MYSQL * mysql);
```

## Parameter

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

## Description

Checks if the client is connected to a MariaDB or MySQL database server.

## Return Value

Returns a non zero value if connected to a MariaDB database server, otherwise zero.
