Oracle 5.0 Reference Manual page 2286

Table of Contents

Advertisement

mysql_fetch_lengths
mysql_fetch_row, mysql_fetch_assoc, mysql_fetch_array, and
an array, starting at offset 0.
Parameters
result
Return Values
An array of lengths on success or
Examples
Example 20.44. A
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row
= mysql_fetch_assoc($result);
$lengths = mysql_fetch_lengths($result);
print_r($row);
print_r($lengths);
?>
The above example will output something similar to:
Array
(
[id] => 42
[email] => user@example.com
)
Array
(
[0] => 2
[1] => 16
)
See Also
mysql_field_len
mysql_fetch_row
strlen
20.7.2.5.17.
mysql_fetch_object
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysql_fetch_object
Fetch a result row as an object
Original MySQL API (Mysql)
stores the lengths of each result column in the last row returned by
The result resource that is being evaluated. This result comes from
a call to mysql_query.
FALSE
mysql_fetch_lengths
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
MySQLi
on failure.
example
or
PDO_MySQL
2266
mysql_fetch_object
extension should be used. See
in

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents