---
title: "php数据库如何避免出现中文乱码"
author: "piperzero"
date: "2013-06-13T18:19:00Z"
tags: []
slug: "php"
draft: false
lastmod: "2013-07-16T08:32:17Z"
id: 1906913
url: "https://piperzero.iteye.com/blog/1906913"
---

&lt;?php

$conn=mysql\_connect("localhost","root","root");

mysql\_select\_db("db",$conn);

mysql\_query("set names gb2312");  
?&gt;

&lt;wbr&gt;&lt;/wbr&gt;