#37867 [Opn->WFx]: MySQL extension lacks charset function
| From: | georg@php.net | Date: | Wed, 21 Jun 2006 06:54:28 +0000 |
| Subject: | #37867 [Opn->WFx]: MySQL extension lacks charset function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98614@lists.php.net to get a copy of this message | ||
ID: 37867
Updated by: georg@php.net
Reported By: yu at nic dot fujitsu dot com
-Status: Open
+Status: Wont fix
Bug Type: MySQL related
Operating System: NetBSD 3.0
PHP Version: 4.4.2
New Comment:
To use the features of MySQL 4.1 and above you should use the mysqli
extension, which has mysqli_set_charset function.
Previous Comments:
------------------------------------------------------------------------
[2006-06-21 04:14:20] yu at nic dot fujitsu dot com
Description:
------------
MySQL4.1 and MySQL5 have a function,
mysql_set_character_set(), which sets up MySQL internal
character set.
To set MySQL character set correctly both in client-side
and in server-side, calling this function is the only
right way after the connection is created (by mysql_real_connect()).
It is not right to call "set names" SQL statement by
mysql_query, because this call sets only in server-side
charset. To set up client-side charset, mysql_set_character_set() is
needed. But PHP4.4.2 and 5.1.4
have no interface to call this function.
(There is another way to set charset correctly.
Calling mysql_options() with MYSQL_SET_CHARSET_NAME before
mysql_real_connect() do the same thing internally.
But PHP4.4.2 and 5.1.4 don't have this interface.)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37867&edit=1