Oracle 5.0 Reference Manual page 2291

Table of Contents

Advertisement

See Also
mysql_field_type
mysql_field_len
20.7.2.5.20.
mysql_field_len
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysql_field_len
Returns the length of the specified field
Description
int mysql_field_len(
resource result,
int field_offset);
mysql_field_len
Parameters
result
field_offset
Return Values
The length of the specified field index on success or
Examples
Example 20.49.
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
// Will get the length of the id field as specified in the database
// schema.
$length = mysql_field_len($result, 0);
echo $length;
?>
Notes
Original MySQL API (Mysql)
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
MySQLi
also
MySQL: choosing an API
Alternatives to this function include:
mysqli_fetch_field_direct
PDOStatement::getColumnMeta
returns the length of the specified field.
The result resource that is being evaluated. This result comes from
a call to mysql_query.
The numerical field offset. The
field_offset
issued.
example
mysql_field_len
or
PDO_MySQL
extension should be used. See
guide and
related FAQ
[length]
[len]
field_offset
does not exist, an error of level
on failure.
FALSE
2271
for more information.
starts at 0. If
E_WARNING
is also

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents