mysqlinsert PHP+MySQL50 Chinese garbled solution

WBOY
Release: 2016-07-29 08:35:06
Original
942 people have browsed it

I recently studied Apache2+PHP4.4.1+MySQL5.0, and the Chinese characters displayed on the page were all "???.....". I found a lot of information on the Internet and found a simple solution!
Database connection PHP script content:
config.inc.php
//Configure mysql database connection parameters
$db = mysql_connect("localhost", "user","password");
mysql_select_db(" message",$db);
//Add the following line before executing the sql statement
mysql_query("SET NAMES 'gb2312'",$db);
?>

The above introduces the solution to mysqlinsert PHP+MySQL50 Chinese garbled code, including the content of mysqlinsert. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!