---
name: "mysql_stmt_num_rows"
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_num_rows"
---

# mysql\_stmt\_num\_rows(3)

### Name

mysql\_stmt\_num\_rows - Returns number of rows in a prepared statement result set

### Synopsis

-

  ```
  #include <mysql.h>
  unsigned long long mysql_stmt_num_rows(MYSQL_STMT * stmt);
  ```

### Description

Returns the number of rows in the result set. The use of mysql\_stmt\_num\_rows() depends on whether or not you used **[mysql\_stmt\_store\_result(3)](/mysql_stmt_store_result/3.md)** to buffer the entire result set in the statement handle.

### Parameter

- •

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

### Return value

Number of rows in the result set

### Notes

- •

  If you use **[mysql\_stmt\_store\_result(3)](/mysql_stmt_store_result/3.md)**, mysql\_stmt\_num\_rows() may be called immediately.

### See Also

- •

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