mysql - php output garbled characters
伊谢尔伦
伊谢尔伦 2017-06-16 09:18:25
0
2
665

The display in phpmyadmin is normal, but the output to the web page displays garbled characters. (This problem only occurred after I deployed it to the server) All Chinese characters turned into question marks, but everything in my local code was normal.

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
学霸
  1. Set database connection string encoding utf8

  2. Set the character encoding at database level, table level and field level to utf8_general_ci. If not set, the default is latin1_swedish_ci (gbk is supported, utf-8 encoding will cause garbled characters)

Beginners usually make the second mistake, because I did it too,

習慣沉默

Encoding problems and compiler problems can also occur. Some default storage is not utf-8

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template