note 73772 deleted from function.mysqli-fetch-fields by danbrown

From: Date: Fri, 28 Nov 2008 22:46:27 +0000
Subject: note 73772 deleted from function.mysqli-fetch-fields by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147380@lists.php.net to get a copy of this message
Note Submitter: Rob ---- "max_length: The maximum width of the field for the result set." Not a native English speaker, I could be reading this wrong, but the max_length property doesn't reflect the maximum length of a field but returns the current length of the contents of a field (something that can easily be derived using the strlen() function): mysql> describe domains; +--------------+--------------+ | Field | Type | +--------------+--------------+ ... | name | varchar(255) | ... $info = $query->fetch_fields(); foreach ($info as $value) print "[max_length] ".$value->max_length."\n"; This results in: [max_length] 14 The number of characters in this field actually is 14, but the maximum length of the field is 255.

« previous php.notes (#147380) next »