1
$ db鏈接到由mysqli_connect(...)創建的數據庫;mysqli_set_charset未設置字符集
mysqli_set_charset($db,"UTF-8");
die(mysqli_character_set_name($db)); //returns (string) "latin1";
如何解決這個問題?
$ db鏈接到由mysqli_connect(...)創建的數據庫;mysqli_set_charset未設置字符集
mysqli_set_charset($db,"UTF-8");
die(mysqli_character_set_name($db)); //returns (string) "latin1";
如何解決這個問題?
MySQL無法識別「UTF-8」。使用「utf8」。
mysqli_set_charset($db,"utf8");
你可以得到MySQL識別拼寫列表:
SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.CHARACTER_SETS
WHERE CHARACTER_SET_NAME LIKE 'utf%';