note 73772 added to function.mysqli-fetch-fields
| From: | Rob at osu1 dot php dot net | Date: | Fri, 09 Mar 2007 16:24:38 +0000 |
| Subject: | note 73772 added to function.mysqli-fetch-fields | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124271@lists.php.net to get a copy of this message | ||
"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.
----
Server IP: 194.109.193.76
Probable Submitter: 193.173.119.247
----
Manual Page -- http://www.php.net/manual/en/function.mysqli-fetch-fields.php
Edit -- https://master.php.net/note/edit/73772
Del: integrated -- https://master.php.net/note/delete/73772/integrated
Del: useless -- https://master.php.net/note/delete/73772/useless
Del: bad code -- https://master.php.net/note/delete/73772/bad+code
Del: spam -- https://master.php.net/note/delete/73772/spam
Del: non-english -- https://master.php.net/note/delete/73772/non-english
Del: in docs -- https://master.php.net/note/delete/73772/in+docs
Del: other reasons-- https://master.php.net/note/delete/73772
Reject -- https://master.php.net/note/reject/73772
Search -- https://master.php.net/manage/user-notes.php