---
name: "mysql_fetch_lengths"
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_fetch_lengths"
---

# mysql\_fetch\_lengths(3)

### Name

mysql\_fetch\_lengths - returns an array of length values for the current row

### Synopsis

-

  ```
  #include <mysql.h>
  unsigned long * mysql_fetch_lengths(MYSQL_RES * result);
  ```

### Description

The `mysql_fetch_lengths()` function returns an array containing the lengths of every column of the current row within the result set (not including terminating zero character) or `NULL` if an error occurred.

### Parameter

- •

  `result` - a result set identifier returned by **[mysql\_store\_result(3)](/mysql_store_result/3.md)** or **[mysql\_use\_result(3)](/mysql_use_result/3.md)**. ### Notes `mysql_fetch_lengths()` is valid only for the current row of the result set. It returns `NULL` if you call it before calling **[mysql\_fetch\_row(3)](/mysql_fetch_row/3.md)** or after retrieving all rows in the result.

### Return value

An array of unsigned long values . The size of the array can be determined by the number of fields in current result set.

### See also

- •

  **[mysql\_field\_count(3)](/mysql_field_count/3.md)**

- •

  **[mysql\_fetch\_row(3)](/mysql_fetch_row/3.md)**
