PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mysql_field_name> <mysql_field_flags
Last updated: Fri, 22 Aug 2008

view this page in

mysql_field_len

(PHP 4, PHP 5, PECL mysql:1.0)

mysql_field_len Devuelve la longitud del campo específicado

Descripción

int mysql_field_len ( int $id_resultado , int $offset_del_campo )

mysql_field_len() devuelve la longitud del campo específicado.

Example #1 Ejemplo de mysql_fetch_len

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

Por razones de compatibilidad puede usarse también mysql_fieldlen(). Aunque esta función es obsoleta.

Vea tambié mysql_fetch_lengths(), strlen().



add a note add a note User Contributed Notes
mysql_field_len
adam_nospam_hunger at yahoo dot com
30-Oct-2003 07:04
For a mysql type DECIMAL(8,4), the length is returned as 10 (M+2 as per documentation).

mysql_field_name> <mysql_field_flags
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites