data = $data->select();
$this-> display();
}
}
?>
'mysql',
'db_host' => 'localhost',
'db_name' => 'wechar',
'db_user' => 'root',
'db_pwd' => 'root',
'db_port' => 3306,
);
:(
无法加载数据库驱动: think\db\driver\
错误位置
file: e:\thinkphp\thinkphp\library\think\db.class.php line: 42
trace
#0 e:\thinkphp\thinkphp\library\think\db.class.php(42): e('\xe6\x97\xa0\xe6\xb3\x95\xe5\x8a\xa0\xe8\xbd\xbd\xe6\x95\xb0...')
#1 e:\thinkphp\thinkphp\library\think\model.class.php(1423): think\db::getinstance('')
#2 e:\thinkphp\thinkphp\library\think\model.class.php(97): think\model->db(0, '', true)
#3 e:\thinkphp\thinkphp\common\functions.php(621): think\model->__construct('oa_news', '', '')
#4 c:\xampp\htdocs\app\application\home\controller\indexcontroller.class.php(6): m('oa_news')
#5 [internal function]: home\controller\indexcontroller->index()
#6 e:\thinkphp\thinkphp\library\think\app.class.php(164): reflectionmethod->invoke(object(home\controller\indexcontroller))
#7 e:\thinkphp\thinkphp\library\think\app.class.php(205): think\app::exec()
#8 e:\thinkphp\thinkphp\library\think\think.class.php(120): think\app::run()
#9 e:\thinkphp\thinkphp\thinkphp.php(97): think\think::start()
#10 c:\xampp\htdocs\app\index.php(24): require('e:\\thinkphp\\thi...')
#11 {main}
回复讨论(解决方案) 你的 mysql 没有启动,或没有加载 mysql 扩展
你可以试试127.0.0.1 有可能你loacalhost访问不了mysql。
问题已经解决了 谢谢