[英]Having problems inserting Greek/Turkish/Polish letters into mysql database with PHP
我正在從經過utf8_unicode_ci編碼的表中讀取單詞Αθήνα
,並且可以在utf-8 HTML頁面上毫無問題地顯示它。 我刮了一些希臘,這也正確顯示。 現在我想將信息寫回到另一個utf8表中的數據庫。 但結果是這樣的: ?????
或Î?θήνα
(當我在上面使用utf8_encode()時)。 我也設定
$this -> mysqli->set_charset("utf8");
我在做什么錯,這讓我發瘋了? 任何幫助表示感謝!
它基本上
讀出:
$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}'
)
");
插入任何內容之前,請嘗試執行“ SET NAMES utf8”。 有一種現代的方法可以執行此操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.