<?php
//数据库连接信息
$cfg_dbhost = '~dbhost~';
$cfg_dbname = '~dbname~';
$cfg_dbuser = '~dbuser~';
$cfg_dbpwd = '~dbpwd~';
$cfg_tablepre = '~dbtablepre~';
$cfg_dbcharset = '~dbcharset~';

//连接数据库
if( function_exists('mysql_pconnect') ){
	$db = mysql_pconnect("$cfg_dbhost", "$cfg_dbuser", "$cfg_dbpwd");
}else{
	$db = mysql_connect("$cfg_dbhost", "$cfg_dbuser", "$cfg_dbpwd");
}

mysql_select_db("$cfg_dbname");
//连接数据库

if( mysql_get_server_info() > '4.1' && $cfg_dbcharset){
			mysql_query("SET NAMES '".$cfg_dbcharset."'");
}
if( mysql_get_server_info() > '5.0' ){
			mysql_query("SET sql_mode=''");
}

?>