1 <?php 2 header("content-type:text/html;charset = utf-8"); 3 $dblink = mysql_connect("localhost","用户名","密码") or die("数据库连接失败"); 4 mysql_select_db("要操作的数据库"); 5 mysql_query("set names utf8");//数据库编码 6 ?>
1 <?php 2 header("content-type:text/html;charset = utf-8"); 3 $dblink = mysql_connect("localhost","用户名","密码") or die("数据库连接失败"); 4 mysql_select_db("要操作的数据库"); 5 mysql_query("set names utf8");//数据库编码 6 ?>