#1 dcb110
$arr=array('driver' => 'mysql', // 驱动类型
'host' => 'localhost', // 数据库地址
'port' => 3306, // 端口
'login' => 'root', // 用户名
'password' => '123456', // 密码
'database' => 'hello', // 库名称
'prefix' => '', // 表前缀
'persistent' => FALSE, // 是否使用长链接
);
$dsn_mysql = spClass('db_mysql',$arr, SP_PATH.'/Drivers/mysql.php', TRUE);
$g = spClass('hi');
$g->_db = $dsn_mysql;
$g->findAll();
dump($g);
$this->display('test.html');
运行时出现错误数据库链接错误 : Access denied for user 'ODBC'@'localhost' (using password: NO)
2016-05-26 10:44:23