How to insert special language characters in PHP into MySQL database?

扶醉桌前 提交于 2019-12-24 02:32:55

问题


I am using latest PHP and latest MySQL. I have tried htmlspecialchars and mysql_real_escape_string but it inserts ? instead of the special character. I am inserting into varchar and text type fields. Special language characters like őúáűăţşîâ but it maight be other languages' characters.


回答1:


Check the default encoding for your server, your meta-tag encoding declaration, and your collation on your database and tables are. You may want to make sure that everything is set to UTF8 if you're going to have lots of language characters.



来源:https://stackoverflow.com/questions/8568301/how-to-insert-special-language-characters-in-php-into-mysql-database

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