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

WBOY
Release: 2016-07-21 15:51:27
Original
1438 people have browsed it

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...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template