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("数据库连接失败");
	}
?>

  

posted on 2017-11-15 14:18  木之子梦之蝶  阅读(5895)  评论(0编辑  收藏  举报

导航