問題描述
我嘗試輸入阿拉伯文本并使用 php 將其插入到 mysql 數據庫中,當打印該行時,所有阿拉伯文行看起來像:
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ù…?§ù? ?§ù??§?±?ˉù? ?§ù??§?±?ˉù? ?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨?¨
我將我的數據庫設置為:字符集:utf8 -- UTF-8 Unicode整理:utf8_general_ci
i set my database to: Character set: utf8 -- UTF-8 Unicode Collation: utf8_general_ci
以及數據庫中的每個字段:字符集:utf8整理:utf8_general_ci
and every field in database: Character set: utf8 Collation: utf8_general_ci
我需要解決這個問題,我感謝所有的答案..
i need to solve this problem and i appreciate all answers ..
推薦答案
執行以下操作:
在應用程序的每個頁面中包含以下查詢
mysql_query("SET NAMES 'utf8'");
請放心,您的網頁是由以下元標記編碼的 utf-8:
Be assured that your web pages are utf-8 encoded by the following meta tag:
這篇關于將阿拉伯語數據插入mysql數據庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!