入口mysql配置

<?php 

/*** 系统路径,可根据需求更改路径 */ 

define('ROOT', './'); 

define('DB_HOST', 'localhost'); 

define('DB_USER', 'root'); 

define('DB_PASSWORD', 'root'); 

define('DB_NAME', 'phpdev'); 

require_once(ROOT."conn/db.inc.php"); 

$db = new DbClass; 

/* 

设置字符集,如utf-8和gbk、Latin1等,根据数据库的字符集而定,如果是Latin1,则可以不需要运行 

*/ 

$sql = "SET NAMES 'utf8'"; 

$db->query($sql); 

?> 
原文地址:https://www.cnblogs.com/flying-tx/p/3796885.html