---
name: "mysql_stmt_next_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_stmt_next_result"
---

# mysql\_stmt\_next\_result(3)

### Name

mysql\_stmt\_next\_result - prepares next result set of a prepared statement

### Synopsis

-

  ```
  #include <mysql.h>
  int mysql_stmt_next_result(MYSQL_STMT * stmt);
  ```

### Description

Prepares next result set from a previous call to **[mysql\_stmt\_execute(3)](/mysql_stmt_execute/3.md)** which can be retrieved by **[mysql\_stmt\_store\_result(3)](/mysql_stmt_store_result/3.md)**.

### Parameter

- •

  `stmt` - a statement handle, which was previously allocated by \[mysql\_stmt\_init()\](mysql\_stmt\_init().\]\]

### Return value

Returns zero on success, nonzero if an error occurred.

### Notes

- •

  The function **[mysql\_stmt\_more\_results(3)](/mysql_stmt_more_results/3.md)** indicates if further result sets are available.

- •

  If the execution of a stored procedure produced multiple result sets the return value of **[mysql\_stmt\_errno(3)](/mysql_stmt_errno/3.md)**/error() might change and there will be no result set available.

### See also

- •

  **[mysql\_stmt\_execute(3)](/mysql_stmt_execute/3.md)**

- •

  **[mysql\_stmt\_more\_results(3)](/mysql_stmt_more_results/3.md)**
