Insert Arabic data into mysql database

僤鯓⒐⒋嵵緔 提交于 2020-01-21 05:10:20

问题


i tried entering Arabic text and insert it into mysql database using php, when print the row, all rows that in arabic looks like :

???? ???? ???? ????? ابو نصير عمان الاردن الاردن بببببببببببببببببب

i set my database to: Character set: utf8 -- UTF-8 Unicode Collation: 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:


Do the following:

  1. Include the following query in every page of your application mysql_query("SET NAMES 'utf8'");

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



来源:https://stackoverflow.com/questions/16575099/insert-arabic-data-into-mysql-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!