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.
欧阳克2017-06-16 09:20:25
Set database connection string encoding utf8
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,
習慣沉默2017-06-16 09:20:25
Encoding problems and compiler problems can also occur. Some default storage is not utf-8