php-mysqlä¹±ç é®é¢ã
SET NAMES UTF8
ï¼é²æ¢mysqlæ个å符é设置çä¸æ£ç¡®ã
ä»å¤©çªç¶æ³æµè¯ä¸ä¸ï¼ç¶åå°è¯æSET NAMES UTF8
注éæï¼æmysql端ç
character_set_connection
character_set_results
character_set_server
character_set_client
ç»ç»global
设置为utf8
ç¶åçç¶åï¼åç°æå ¥ä¸æå符åæ¯ä¹±ç äºï¼æ´ä¸ªäººé½ä¸å¥½äºã
æ¬å°ç代ç åæ°æ®åºè¯å®æ¯UTF8
ç
å¦ææç
§client->connection->server
ææ¥çè¯æ¯æ²¡æé®é¢çï¼ä¸ºä»ä¹è¿ä¼åºéå¢ï¼
åå¤å 容ï¼
PHPå¨è¿æ¥æ°æ®åºåé½è¦æ§è¡SET NAMES UTF8
ï¼é²æ¢mysqlæ个å符é设置çä¸æ£ç¡®ã
ä»å¤©çªç¶æ³æµè¯ä¸ä¸ï¼ç¶åå°è¯æSET NAMES UTF8
注éæï¼æmysql端ç
character_set_connection
character_set_results
character_set_server
character_set_client
ç»ç»global
设置为utf8
ç¶åçç¶åï¼åç°æå ¥ä¸æå符åæ¯ä¹±ç äºï¼æ´ä¸ªäººé½ä¸å¥½äºã
æ¬å°ç代ç åæ°æ®åºè¯å®æ¯UTF8
ç
å¦ææç
§client->connection->server
ææ¥çè¯æ¯æ²¡æé®é¢çï¼ä¸ºä»ä¹è¿ä¼åºéå¢ï¼
è¿æ¥è®¾ç½®éï¼æå®utf-8ç¼ç