mysql_fetch_lengths

array mysql_fetch_lengths(mysql result result_handle) 

Gets the length of each field in a row.

Returns:

Array of integers; FALSE on error

Description:

mysql_fetch_lengths() fetches the length of each field for the last row of data retrieved by mysql_fetch_array(), mysql_fetch_assoc(), mysql_fetch_object(),or mysql_fetch_row(). The length information is returned in a numerically keyed array.

Version:

PHP 3+, PHP 4+

See also:

To find the number of fields in a result set:

mysql_num_fields() 

To find the number of rows in a result set:

mysql_num_rows() 

Example:

Fetch all column data from a result handle returned by mysql_query()
 <pre> <?php // Included code that connects to a MySQL server and sets a default database // See ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.