将阿拉伯语数据插入mysql数据库 [英] Insert Arabic data into mysql database

查看:37
本文介绍了将阿拉伯语数据插入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 ..

推荐答案

执行以下操作:

  1. 在应用程序的每个页面中包含以下查询mysql_query("SET NAMES 'utf8'");

请放心,您的网页是由以下元标记编码的 utf-8:

Be assured that your web pages are utf-8 encoded by the following meta tag:

这篇关于将阿拉伯语数据插入mysql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆