Home  >  Article  >  Backend Development  >  Get the field length in php mysql_field_len_PHP tutorial

Get the field length in php mysql_field_len_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:04:081023browse

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630894.htmlTechArticlephp gets the field length mysql_field_len 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. Data...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn