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数据库
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何替换eregi() 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
