Insert Arabic data into mysql database(将阿拉伯语数据插入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:
这篇关于将阿拉伯语数据插入mysql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将阿拉伯语数据插入mysql数据库
基础教程推荐
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- php中的PDF导出 2022-01-01
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- Web 服务器如何处理请求? 2021-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- 将变量从树枝传递给 js 2022-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- php中的foreach复选框POST 2021-01-01
