PHP MySQL connection collation
To change the connection charset permanently to UTF-8, add the following line in the [mysqld] section:
[mysqld]
init-connect='SET NAMES utf8'
The other way to let MySQL know what connection charset you intend to use is per-connection based. After a connection is established (with host, name, password), add the following two lines in your application:
SET NAMES utf8;
SET CHARACTER_SET utf8;
[mysqld]
init-connect='SET NAMES utf8'
The other way to let MySQL know what connection charset you intend to use is per-connection based. After a connection is established (with host, name, password), add the following two lines in your application:
SET NAMES utf8;
SET CHARACTER_SET utf8;
Labels: Linux, Programming

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home