问题
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:
Include the following query in every page of your application
mysql_query("SET NAMES 'utf8'");
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