mysql_query question
Posted: Wed Jul 20, 2005 1:30 am
i have my old blog using old php and mysql version, and mysql with utf-8 encoding.
now i'm testing latest php and mysql version, then import my old s9y database to the new one, but my chinese entries are all messed up.
then i add this line
@mysql_query("SET NAMES UTF8");
to /include/db/mysql.inc.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 mysql.inc.php.
maybe add something to my.ini but i don't know what is the correctly syntax.
it seems stranage that i have to use SET NAMES when the default character set is already utf-8. anybody have experience with this?
thanks
now i'm testing latest php and mysql version, then import my old s9y database to the new one, but my chinese entries are all messed up.
then i add this line
@mysql_query("SET NAMES UTF8");
to /include/db/mysql.inc.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 mysql.inc.php.
maybe add something to my.ini but i don't know what is the correctly syntax.
it seems stranage that i have to use SET NAMES when the default character set is already utf-8. anybody have experience with this?
thanks