‘DB_DSN‘=>‘mysql:host=IP;port=3307;dbname=test;charset=utf8‘,
$db = 10.15.208.206;port=3307
/**
* 连接数据库
*/
public function connect($host, $user, $pass, $db)
{
try {
$this->_resource =new PDO("mysql:dbname=$db;host=$host", $user, $pass);
return $this->_resource;
}catch (PDOException $e){
return null;
}
//return null;
}