> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_lengths.md).

# mysql\_fetch\_lengths

## Syntax

```c
unsigned long * mysql_fetch_lengths(MYSQL_RES * result);
```

## Parameter

* `result` - a result set identifier returned by [mysql\_store\_result()](/docs/connectors/mariadb-connector-c/api-functions/mysql_store_result.md) or [mysql\_use\_result()](/docs/connectors/mariadb-connector-c/api-functions/mysql_use_result.md).

## 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.

## 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.

{% hint style="info" %}
`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()](/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_row.md) or after retrieving all rows in the result.
{% endhint %}

## See Also

* [mysql\_fetch\_row()](/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_row.md)
* [mysql\_field\_count()](/docs/connectors/mariadb-connector-c/api-functions/mysql_field_count.md)

{% @marketo/form formId="4316" %}
