can't insert russian text into mysql database

前端 未结 5 2397
青春惊慌失措
青春惊慌失措 2020-12-03 06:29

When I\'m trying to insert russian text into MySQL database it inserts it like: г???????????? ?? ????????
Рісѓрїр°ріс‹рї р° с‹рір°рї

So, I have two pages: regist

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 07:02

    Try calling mysql_set_charset('utf8'); after connecting to the database. I think it's similar to executing a SET NAMES query, but since the PHP manual says using that function over a SET NAMES query is recommended, I'd try it.

    Also, when you display your content, you could try echo htmlentities($string, ENT_COMPAT, 'UTF-8');

提交回复
热议问题