Home > Article > Backend Development > Get the field length in php mysql_field_len_PHP tutorial
php gets the field length mysql_field_len is used to get the length of the value returned by mysql_query,
Syntax:
mysql_field_len(data,field_offset)
data: required. The specified data pointer is used. The data pointer is due from the mysql_query() function
field_offset:required. Specify where to start and return. 0 means the first field
$sql = "SELECT * from Person"; $result = mysql_query($sql,$con);
$length = mysql_field_len($result, 0);
echo $length;
结果为
20