When php encoding is used to operate the database, Chinese characters are added to the table, but not displayed in the database... Excuse me: what encoding does this php file use? Do I need to set setnamesgbk for mysql databases? How to set the encoding? Cainiao is asking for advice .. ------ Solution -------------------- showvariableslike % char %; is it under the command line? S about php coding
When you use php to operate databases and add Chinese characters to tables, the database cannot be displayed... Excuse me:
What encoding is used for this php file?
Do I need to set names gbk for mysql databases?
How to set the encoding? Cainiao is asking for advice ..
------ Solution --------------------
Show variables like '% char %'; is it in the command line?
Set names utf8 only applies to the current connection. After the php program is executed, the connection is disconnected, even if it becomes invalid.