問題描述
我嘗試輸入阿拉伯文本并使用 php 將其插入到 mysql 數(shù)據(jù)庫(kù)中,當(dāng)打印該行時(shí),所有阿拉伯文行看起來像:
i tried entering Arabic text and insert it into mysql database using php, when print the row, all rows that in arabic looks like :
??????????????????§?¨ù? ù??μù??± ?1ù…?§ù? ?§ù??§?±?ˉù? ?§ù??§?±?ˉù??¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨
???? ???? ???? ????? ?§?¨ù? ù??μù??± ?1ù…?§ù? ?§ù??§?±?ˉù? ?§ù??§?±?ˉù? ?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨
我將我的數(shù)據(jù)庫(kù)設(shè)置為:字符集:utf8 -- UTF-8 Unicode整理:utf8_general_ci
i set my database to: Character set: utf8 -- UTF-8 Unicode Collation: utf8_general_ci
以及數(shù)據(jù)庫(kù)中的每個(gè)字段:字符集:utf8整理:utf8_general_ci
and every field in database: Character set: utf8 Collation: utf8_general_ci
我需要解決這個(gè)問題,我感謝所有的答案..
i need to solve this problem and i appreciate all answers ..
推薦答案
執(zhí)行以下操作:
在應(yīng)用程序的每個(gè)頁(yè)面中包含以下查詢
mysql_query("SET NAMES 'utf8'");
請(qǐng)放心,您的網(wǎng)頁(yè)是由以下元標(biāo)記編碼的 utf-8:
Be assured that your web pages are utf-8 encoded by the following meta tag:
這篇關(guān)于將阿拉伯語(yǔ)數(shù)據(jù)插入mysql數(shù)據(jù)庫(kù)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!