PHP.nl

mysql_field_len

mysql_field_len

Returns the length of the specified field

Waarschuwing: > mysqli_fetch_field_direct``PDOStatement::getColumnMeta

 **mysql_field_len** resource $result int $field_offset
returns the length of the

specified field. mysql_field_len

The length of the specified field index on successreturn.falseforfailure.

Voorbeeld: example

<?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;
?>

Opmerking: > info.deprecated.alias

mysql_fieldlen

mysql_fetch_lengths``strlen