¼s¨ü«È¤á¦nµû¡Aº¡¨¬±zªº©~®a¦¬¯Ç©M·®æ¡A§K¶O¤V¶q³]p «È»s¤Æ¨t²Î®a¨ã¡A¥R¤Àº¡¨¬©~®aªÅ¶¡¾÷¯à»Ý¨D | ²{³õ§K¶O±M¤H¦ô»ù¡A¼t©Ð©î°£¡B¹H³¹«Ø¿v©î°£ ±M·~¤uµ{¹Î¶¤¡A¿Ë¤Á¥Î¤ßªA°È±z¡I |
mysql 4.1¤¤¤å¶Ã½X°ÝÃD |
©ÐªF¡Gªü«O µoªí®É¶¡¡G2007-03-06 |
¤j³¡¥÷¤H¤É¯Åwordpress 1.5®É¸I¨ìªº°ÝÃD³£¬O¤¤¤å¶Ã½X¡A¤×¨ä¬O¦pªG쥻¥Î mysql 4.0 ¦Ó¦P®Én¤É¯Å¨ì mysql 4.1ªº¸Ü¡C ¥Dnì¦]¬Omysql 4.1¦b»y¨t¤è±¼W¥[¤F³\¦h¥\¯à¡A¥¦¥i¥H³]©w»y¨tªº¼h¦¸±q³Ì©³¼hªº server, database ¨ì³æ¤@ table, column, connection ³£¥i¥H³]©w¡A¦Ó°£¤F»y¨t¤§¥~¡AÁÙ¥i¥H«ü©w·f°t¤£¦Pªº collation¡A©Ò¥H²Õ¦X¦Ê¦ÊºØ¡A¥un¤@Ó¿ù¤F´NÃø°k¶Ã½Xªº©R¹B¡C(¦Ó¤§«e¥Îmysql 4.0¬°¦ó¤£¥Î³]©w¤]¤£·|¥X°ÝÃD©O¡H¥Dnì¦]¬O¨º®É¹w³]¬O latin-1¡A¥¿¦n¬Û®e¤j³¡¥÷ªºutf-8¦r¤¸¡A©Ò¥H¤£±`¸I¨ì¶Ã½X) ©Ò¥H¦pªG§Aªº±¡ªp¸ò§Ú¤@¼Ë¡A¦P®Én±N wordpress ±q v1.2¤É¯Å¨ì v1.5, µM«ámysql¤]n v4.0 ¤É¯Å¨ì v4.1 ªº¸Ü¡A½Ð¬Ý¤U±¬yµ{¡G 0. ¥ý¶iphpmyadmin§ä¨ì¥i¿é¤J sql queryªºµe±¡AµM«áÁä¤J¡G show variables like ¡¥%character%¡¦; ³o¥y¸Ü·|Åã¥Ü¥Ø«e¸ê®Æ®w¨Ï¥Îªº»y¨t³]©w¡A¤@¯ë°ê¥~ªººô¯¸©Îè¸Ë¦nªº mysql 4.1¹w³]³£¬O latin-1¡C 1 ·s¼Wwordpress blogn¥Îªºdatabase¦WºÙ¡A¨Ò¦p myblog. ¦pªG§A¼ô±x phpmyadmin ªº¾Þ§@¡A¦bµe±¤W´N¥i¥H¿ï¾Ü³oÓ·sdatabase n¥Îªº»y¨t¡A charset ½Ð¿ï¾Ü UTF-8 Unicode (utf8) collation ½Ð¿ï¾Ü utf8_general_ci (ci ¥Nªí case insensitve ¤j¤p¼g¨S®t) 2¡B§ï database»y¨t¡A¦P¼Ë¦b phpmyadmin ªºqueryµe±Áä¤J¤U±¨â¦æ¡G ¦pªG§A¦b¤W¤@¨B¤¤¨S¥¿½T¿ï¾Ü»y¨t¡A©Î¬O¦b¬Ý¨ì¥»¤å«e¤w¸g¥ý«Ø¦ndatabase¤F¤]¨SÃö«Y¡A¥Î¤U±»yªk¥i¥H§ï¦^¨Ó alter database myblog character set utf8; 3¡B¶×¤Jªº sql ¨ì³oùج°¤îmysqlùر¤w¸g¦³¤@Ó utf-8ªº database, ¥i¥H·Ç³Æ˸ê®Æ¶i¥h¤F¡A§âª©ªºsql ¤å¦rÀɪ½±µcopy-paste©Î¤W¶Ç¨ì phpmyadmin§Y¥i¡Cª`·Nn§i¶Dphpmyadmin³oÓ¤å¦rÀɬO utf-8 ½s½Xªº¤~¯à¥¿½T¶×¤J¡C ®Ú¾Ú§Úªº¸gÅç¡AÁ`¬O·|¦³¤@¨âÓ¤p¦a¤è¥X°ÝÃD¡A¥i¯àn¤â°Êקï¤@¤U¤º®e¡A¨Ò¦p±N¬Y¨Ç¤¤¤å¦r¥ý´«¦¨^¤å¡Aµ¥Ë¶imysql«á¦A¶iwordpress §ï¦^¨Ó¡C 4¡B§ï wp-db.php ªº³]©w «e±´¿¸g´£¹L¡Amysqlªº»y¨t³]©w¬O¦h¼h¦¸ªº¡A«e±§Ú̧âdatabase»Ptableªº»y¨t³£³]©w¥¿½T¡A¦ýµ{¦¡»Pmysql³s½u®Éªº»y¨t«h¬O¥Ñ connection ¨Ó¨M©w¡A³o³¡¥÷´Nn§ïwordpressªºµ{¦¡½X¡A¦b \wp-includes\wp-db.php ªº²Ä 44¦æ¥[¤W¡G $this->query(¡¨SET NAMES ¡¥utf8¡¬¡¨); ³o¥y¸Ü·|¦P®É³]©w client, results, connection¤TªÌ¨Ï¥Îªº»y¨t¬° utf-8¡C ¡¯³Ì«áÀˬd¬O§_¥þ³¡§ï¦¨ utf-8 show variables like ¡¥%character%¡¦; ¦¹®É§AÀ³¸Ó·|¬Ý¨ì¤j³¡¥÷Äæ¦ì³£¬Outf-8¤F¡A°£¤F server ³o¶µ¤§¥~¡A¦]¬°§Ú¬O¥Î§O¤Hªºhosting¥D¾÷¡A©Ò¥H¨Sªk¨à§ï³o³¡¥÷¡A¦ý¥±`°µ®×¤l®É¤j³¡¥÷³£¥i¥Hª½±µ±±ºÞmysql¡A¦¹®É´N¥i¥H¥Î my.ini ³]©w¡G [mysqld] default-character-set=utf8 §i¶Dmysql server±Ò°Ê®Én¥Î utf-8§Y¥i¡C ªþ±a¤@´£¡A¸g¹L³o¼Ë½Õ®Õªºmysql¡A³s±µ flash - amfphp - php - mysql ¤]§¹¥þ¨S°ÝÃD¡A¥i¥H¤¬¶Ç¤¤¤å/¤é¤å¡C |
|
1 ¼Ó¦í¤á¡G¹F¤H µoªí®É¶¡¡G2007-06-08 |
mysql ·|¥X²{¤¤¤å¶Ã½Xªºì¦]¤£¥~¥G¤U¦C´XÂI¡G //database connection details. $host = "localhost"; $link = mysql_connect($host, "xxx", "xxx"); mysql_query("SET NAMES 'utf8'"); mysql_select_db("your_table_name_here", $link); ?>
|
2 ¼Ó¦í¤á¡G·s¤â µoªí®É¶¡¡G2007-06-08 |
< ? //database connection details. $host = "localhost"; $link = mysql_connect($host, "xxx", "xxx"); mysql_query("SET NAMES 'Big5'"); mysql_select_db("your_table_name_here", $link); ?> ¥Î³oÓ¤èªk¤]¥i¥H.. mysql_connect «á¦³¥[¤W¤@Ó "set names ¡¥Big5¡¬ " «ü¥O §i¶D mysql ³oÓ connection ¤§«áªº³s½u¤º®e³£n¨Ï¥ÎBig5 ¸g¹L³o¼Ë³]©w«á.. ³q±`´N¥i¥H¸Ñ¨M¤j³¡¥÷°ÝÃD |
©m¦W¡G | |||
§G§i¤º®e¡G | |||
¨ä¥L¿ï¶µ: | |||
|