将阿拉伯语数据插入mysql数据库
我尝试输入阿拉伯文本并使用 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 :
?????????????????ابو نصير عمان الاردن الاردنبببببببببببببببببب
???? ???? ???? ????? ابو نصير عمان الاردن الاردن بببببببببببببببببب
我将我的数据库设置为:字符集: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:
相关文章