mysql\_send\_query(3) MariaDB Connector/C mysql\_send\_query(3)

## [Name](#Name)

mysql\_send\_query - sends a SQL statement without waiting for server response

## [Synopsis](#Synopsis)

```
#include <mysql.h>
int mysql_send_query(MYSQL * mysql,


                     const char *query,


                     unsigned long length);
    
```

## [Description](#Description)

Sends a statement to the server, without waiting for the Server OK packet and/or resultset.

## [Parameters](#Parameters)

•

mysql - a mysql handle, which was previously allocated by [**mysql\_init(3)**](/man/enterprise-packages/mariadb-12.2/mysql_init.3) and connected by [**mysql\_real\_connect(3)**](/man/enterprise-packages/mariadb-12.2/mysql_real_connect.3).

•

query - SQL statement

•

length - length of the SQL statement

## [Notes](#Notes)

•

The OK and result set package need to be retrieved by [**mysql\_read\_query\_result(3)**](/man/enterprise-packages/mariadb-12.2/mysql_read_query_result.3) function

•

mysql\_send\_query() can be used for semi asynchronous operation. While the function itself is blocking, an event driven application can do other tasks until result set is available.

## [Example](#Example)

For an example how to use ’mysql\_send\_query()\` in an event driven model, please check Jan Kneschke’s article [“Async MySQL Queries with C-API”](https://jan.kneschke.de/projects/mysql/async-mysql-queries-with-c-api/).

## [See also](#See_also)

•

mysql\_real\_query

•

mysql\_read\_query\_result

Version 3.4

---

Document: mysql_send_query(3) from mariadb-12.2 12.2.2-r9 (Chainguard OS)
Source: https://github.com/MariaDB/server.git
