Home  >  Article  >  Backend Development  >  Solve the problem of MySQL Chinese output turning into question marks_PHP tutorial

Solve the problem of MySQL Chinese output turning into question marks_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:51:271410browse

So I added: mysql_query("SET NAMES GB2312"); the problem was solved. Mainly a coding issue.

Pay attention to the insertion position of this code. It should be inserted before the code that displays the data, otherwise it will be meaningless. For details, please refer to the PHP program for displaying MySQL data that I released last time.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319159.htmlTechArticleSo I added: mysql_query("SETNAMESGB2312"); to the program and the problem was solved. Mainly a coding issue. Pay attention to the insertion position of this code. It should be inserted in the code that displays data...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn