0
我正從utf8_unicode_ci編碼的表中讀取Αθήνα
這個詞,它可以在utf-8 HTML頁面上毫無問題地顯示它。我颳了一些更多的希臘,這也是正確顯示。現在我想在另一個utf8表中將信息寫回數據庫。但結果是這樣的:?????
或Î?θήνα
(當我使用utf8_encode())。 我還設置在使用PHP將希臘/土耳其/波蘭語字母插入到mysql數據庫時遇到問題
$this -> mysqli->set_charset("utf8");
我在做什麼錯了,這是推動我瘋了嗎?任何幫助很感激thx很多!
它基本上
讀出:
$result = $this -> mysqli->query("SELECT * FROM `A` WHERE `country_code` = 'GRC'");
/* Tell browser to use UTF-8 */
header("Content-Type: text/html; charset=utf-8");
/* The actual scrape loop, done for every found entry in the urls table*/
while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
$this -> urls_array[] = $row;
}
回寫:
$deal=$this -> urls_array[$key];
$this -> mysqli->query("INSERT INTO `B` (`city_name`,`title`....)
VALUES (
'{$deal["city_name"]}',
'{$title}'
)
");
請顯示更多驗證碼。你在哪裏刮? – 2011-02-22 17:47:19
它不僅解決了這個問題,而且還從數據庫中讀取希臘語,並且立即寫回到另一個表格不起作用。它存儲在一個`fetch_array(MYSQLI_ASSOC)`和`mb_detect_encoding`的數組中,告訴我它確實是utf8。 – kritop 2011-02-22 17:51:17