Search Results
Returns an array that corresponds to the lengths of each field in the last row fetched by MySQL. mysql_fetch_lengths () stores the lengths of each result column in the last row returned by mysql_fetch_row (), mysql_fetch_assoc (), mysql_fetch_array (), and mysql_fetch_object () in an array, starting at offset 0.
Definition and Usage The lengths / mysqli_fetch_lengths () function returns the length of the fields of the current row in the result-set.
- Definition and Usage
- Return Values
- Example
A PHP result object (of the class mysqli_result) represents the MySQL result, returned by the SELECT or, DESCRIBE or, EXPLAIN queries. The mysqli_fetch_lengths()function accepts a result object as a parameter, retrieves the lengths of columns in the current row of the given result, and returns them in the form of an array.
The PHP mysqli_fetch_lengths() function returns an array (of integers) containing the length/size of each column (of the current row), if successful and, it returns the boolean value FALSEin case of an error.
Following example demonstrates the usage of the mysqli_fetch_lengths()function (in procedural style) − This will produce following result −
The MySQLi::fetch_lengths () method provides a straightforward way to obtain the byte length of each column's data in the current row from a MySQL result set. This can aid in validation, debugging, and output formatting when dealing with database-driven PHP applications.
mysql_fetch_lengths () stores the lengths of each result column in the last row returned by mysql_fetch_row (), mysql_fetch_assoc (), mysql_fetch_array (), and mysql_fetch_object () in an array, starting at offset 0.
Please update any bookmarks that point to the old page.
People also ask
What does MySQL_fetch_lengths do?
What is PHP mysqli_fetch_lengths() function?
How do I get the length of a row in MySQL?
What is PDO_MySQL in PHP?
Returns an array that corresponds to the lengths of each field in the last row fetched by MySQL. mysql_fetch_lengths stores the lengths of each result column in the last row returned by mysql_fetch_row, mysql_fetch_assoc, mysql_fetch_array, and mysql_fetch_object in an array, starting at offset 0.
