PHP之数据库连接配置文件
<?php
$config=array(
'host' =>'localhost',
'port'=>'3306',
'db' =>'localhost',
'db_user' =>'root',
'db_psw' =>'',
'db_name' =>'test'
);
$connID=@mysqli_connect($config['host'],$config['db_user'],$config['db_psw'],$config['db_name'],$config['port']);
if(!$connID){
echo("数据库连接失败");
}
?>
DO What You Want !