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

search for in the

mysql_fetch_object> <mysql_fetch_field
[edit] Last updated: Fri, 25 May 2012

view this page in

mysql_fetch_lengths

(PHP 4, PHP 5)

mysql_fetch_lengths 取得结果集中每个输出的长度

说明

array mysql_fetch_lengths ( resource $result )

以数组返回上一次用 mysql_fetch_row() 取得的行中每个字段的长度,如果出错返回 FALSE

mysql_fetch_lengths() 将上一次 mysql_fetch_row()mysql_fetch_array()mysql_fetch_object() 所返回的每个列的长度储存到一个数组中,偏移量从 0 开始。

参见 mysql_fetch_row()



add a note add a note User Contributed Notes mysql_fetch_lengths
Bavo Janss 10-Jul-2009 07:19
In case of UTF8 fields mysql_field_len() will return 3 times the maximum length (e.g. 30 for a VARCHAR(10) field)) for mysql_field_len() returns the byte length of the field not the defined size.
09-Feb-2006 06:23
For the maximum length of a field (e.g. 10 for a VARCHAR(10) field), use mysql_field_len().

 
show source | credits | stats | sitemap | contact | advertising | mirror sites