---
name: "mysql_use_result"
section: "3"
platform: "linux"
package: "mariadb"
version: "13.0.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mysql_use_result"
---

# mysql\_use\_result(3)

### Name

mysql\_use\_result - returns an unbuffered result set

### Synopsis

-

  ```
  #include <mysql.h>
  MYSQL_RES * mysql_use_result(MYSQL * mysql);
  ```

### Description

Used to initiate the retrieval of a result set from the last query executed using the mysql\_real\_query() function on the database connection. Either this or the **[mysql\_store\_result(3)](/mysql_store_result/3.md)** function must be called before the results of a query can be retrieved, and one or the other must be called to prevent the next query on that database connection from failing.

### Parameters

- •

  `mysql` is a connection identifier, which was previously allocated by **[mysql\_init(3)](/mysql_init/3.md)** and connected by **[mysql\_real\_connect(3)](/mysql_real_connect/3.md)**.

### Notes

The mysql\_use\_result() function does not transfer the entire result set. Hence several functions like **[mysql\_num\_rows(3)](/mysql_num_rows/3.md)** or **[mysql\_data\_seek(3)](/mysql_data_seek/3.md)** cannot be used. mysql\_use\_result() will block the current connection until all result sets are retrieved or result set was released by **[mysql\_free\_result(3)](/mysql_free_result/3.md)**.

### Return value

Returns an unbuffered result set or `NULL` if an error occurred.

### See also

- •

  **[mysql\_store\_result(3)](/mysql_store_result/3.md)**

- •

  **[mysql\_free\_result(3)](/mysql_free_result/3.md)**
