views:

113

answers:

1

Hi,

I read some articles that promoted the use of the new ext/mysqli in php due to it's support of character sets. I currently use ext/mysql and use SET NAMES UTF-8 to ensure all my data is stored as utf-8. isn't that charset support in ext/mysql or am I missing something larger?

Thanks :)

+1  A: 

SET NAMES UTF-8 does no mean the data are stored in UTF-8. That means that data is RECIEVED in UTF-8 from client and is SERVED in UTF-8 to client.

Storage encoding is set when you create a db/table/row, for example

CREATE TABLE{
  ...
}CHARSET=utf8;

or

 CREATE DATABASE  DEFAULT CHARACTER SET utf8

Read here: http://stackoverflow.com/questions/1714629/mysql-latin1-utf8-convert-characters-to-their-multibyte-equivalents


2 Lyon mysql goes just fine.

Please check once more the encodings of the tables and rows via, for example, phpMyAdmin. Remember that setting encoding to database doesn't automatically change the encoding of tables. It's just used for a default value if table encoding is not specified

Dan
Thanks Dan. I understand it better now. I've actually configured mysql to use DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;Back to my real question though, is that, should I be using mysqli if i want full unicode support? Or can mysql do that just fine? Thanks :)
Lyon
I've double checked it with phpmyadmin too. Appreciate the heads up Dan :) Thanks!
Lyon