News:

Join the Facebook Fan Page.

Main Menu

mysql_query question

Started by CapriSkye, July 19, 2005, 07:34:42 PM

Previous topic - Next topic

CapriSkye

i am testing the newest mysql, with 1.1 beta3 installation and utf-8 encoding.
mysql has utf-8 as default encoding.
after everything is set up, some chinese characters are not showing up correctly.
then i add this line
@mysql_query("SET NAMES UTF8");
to index.php and everything works out so far.

so my question is how do i use SET NAMES UTF8 as default when installing mysql?
that way I don't have to add that line to index.php.
maybe add something to my.ini but i don't know what is the correctly syntax.
anybody have experience with this?
thanks

[Unknown]

It may take using mysqli, or making sure the defaults are set in my.cnf.

-[Unknown]

CapriSkye

i'm using windows by the way.
i do have this
default-character-set=utf8
in my.ini but that doesn't seem to solve it.

[Unknown]

Are you using the default compile?  I think php_mysql.dll is still compiled against 3.23.x by default.... you might have to recompile it against 4.1.x to get this resolved without the SET NAMES.

-[Unknown]

Advertisement: