mysql_field_len

(PHP 3, PHP 4 , PHP 5)

mysql_field_len --  Returns the length of the specified field

Description

int mysql_field_len ( resource result, int field_offset )

mysql_field_len() returns the length of the specified field.

Example 1. mysql_field_len() 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 value in email so for example
// user@example.com would give us a length of 16
$length = mysql_field_len($result, 'email');
echo
$length;
?>

For downward compatibility mysql_fieldlen() can also be used. This is deprecated, however.

See also mysql_fetch_lengths() and strlen().

The Broward PHP Usergroup would like to thank the following sponsors.
  • South Florida Web Design

  • South Florida Maids

  • Miami Cleaning Service

  • Broward PHP Usergroup

  • Nationwide Real Estate Agent Directory

  • Fort Lauderdale Web Design

  • Real Estate Agent

  • Gourmet Flavored Coffee

  • convex optimization

  • convex optimization

  • Nationwide Bail Bonds Agent Directory

  • Fort Lauderdale Computer Repair

  • Broward County Computer Repair

  • dance music video

  • Miami Computer Repair