如何使用PHP从HTML表单正确存储阿拉伯语文本到MySQL数据库?

时间:2022-10-16 13:31:51

I've searched a lot but with no avail!

我搜索了很多但没有用!

>> After the PHP connection I put : mysql_set_charset('utf8', $conn);
>> The form input tag contains attribute : accept-charset="utf-8"
>> I'm sure that the database collation is : utf8_general_ci
>> I've the meta tag in the head : <meta charset="UTF-8">

What should I do now ?? The arabic text is stored like : سÙ

我现在应该怎么做 ??阿拉伯语文本存储如下:سÙ

2 个解决方案

#1


0  

I've found the problem, it was here :

我发现了问题,它在这里:

$blog_title = mysql_real_escape_string(htmlentities(trim($blog_title)));

I don't know what's the problem itself but when I removed it, it works well!

我不知道问题本身是什么,但当我删除它时,它运作良好!

#2


0  

I make the same but : database collation is : utf8_defult collection small letters , I don't know if that problem

我做的相同但是:数据库整理是:utf8_defult收集小写字母,我不知道是不是那个问题

my data is saved in arabic I hope I helped you

我的数据保存在阿拉伯语中我希望我帮助过你

#1


0  

I've found the problem, it was here :

我发现了问题,它在这里:

$blog_title = mysql_real_escape_string(htmlentities(trim($blog_title)));

I don't know what's the problem itself but when I removed it, it works well!

我不知道问题本身是什么,但当我删除它时,它运作良好!

#2


0  

I make the same but : database collation is : utf8_defult collection small letters , I don't know if that problem

我做的相同但是:数据库整理是:utf8_defult收集小写字母,我不知道是不是那个问题

my data is saved in arabic I hope I helped you

我的数据保存在阿拉伯语中我希望我帮助过你