# mysql\_fetch\_lengths

## Syntax

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

* `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.

{% 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)

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_lengths.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
