Re: mysqli_fetch_field() mysqlnd & libmysql differences
Hi,
On Sat, 2012-01-21 at 08:31 -0500, Daniel Convissor wrote:
> Hi Johannes:
>
> > The documentation tells
> >
> > http://dev.mysql.com/doc/refman/5.5/en/c-api-data-structures.html
> >
> > So it is working in bytes and has to hold all possible values.
>
> That's how MySQL's internal API works. At the same time, PHP's users
> expect PHP to behave as documented. http://php.net/mysqli_fetch_field says
> length is "The width of the field, as specified in the table
> definition."
We have to live with the information the server gives us. The server
gives us the information in bytes. And frankly in PHP a string has no
encoding information, so in many cases that is a good answer. But
nonetheless the documentation should be improved/fixed.
johannes
Thread (19 messages)