Home  >  Article  >  Backend Development  >  PHP connection mysql garbled solution_PHP tutorial

PHP connection mysql garbled solution_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:05:48755browse

php tutorial connection mysql tutorial garbled solution

The most common reason for garbled characters is to directly connect to the mysql database tutorial without setting the encoding for the connection query. The commonly used method is mysql_query("set names 'gb2312'"), which can mostly be solved. Let's look at a solution that cannot be solved by the above method. Processing methods.

$link = mysql_connect('localhost','root','');

mysql_query("set character_set_connetion=utf8,character_set_result=utf8, character_set_client=binary",$link);

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630756.htmlTechArticlephp tutorial to connect to mysql tutorial garbled code solution The common problem with garbled code is to directly connect to the mysql database tutorial without setting the encoding for the connection query , the commonly used one is mysql_query(set names 'g...
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