namespace HomeController;
use ThinkController;
class IndexController extends Controller {
public function index(){
$Data = M('oa_news');
$this-> data = $Data->select();
$this-> display();
}
}
?>
return array(
'DB_TYPE' => 'MySql',
'DB_HOST' => 'localhost',
'DB_NAME' => 'Wechar',
'DB_USER' => 'root',
'DB_PWD' => 'root',
'DB_PORT' => 3306,
);
:(
无法加载数据库驱动: ThinkDbDriver
错误位置
FILE: E:ThinkPHPThinkPHPLibraryThinkDb.class.php LINE: 42
TRACE
#0 E:ThinkPHPThinkPHPLibraryThinkDb.class.php(42): E('无法加载数...')
#1 E:ThinkPHPThinkPHPLibraryThinkModel.class.php(1423): ThinkDb::getInstance('')
#2 E:ThinkPHPThinkPHPLibraryThinkModel.class.php(97): ThinkModel->db(0, '', true)
#3 E:ThinkPHPThinkPHPCommonunctions.php(621): ThinkModel->__construct('oa_news', '', '')
#4 C:
mpphtdocsppApplicationHomeControllerIndexController.class.php(6): M('oa_news')
#5 [internal function]: HomeControllerIndexController->index()
#6 E:ThinkPHPThinkPHPLibraryThinkApp.class.php(164): ReflectionMethod->invoke(Object(HomeControllerIndexController))
#7 E:ThinkPHPThinkPHPLibraryThinkApp.class.php(205): ThinkApp::exec()
#8 E:ThinkPHPThinkPHPLibraryThinkThink.class.php(120): ThinkApp::run()
#9 E:ThinkPHPThinkPHPThinkPHP.php(97): ThinkThink::start()
#10 C:
mpphtdocsppindex.php(24): require('E:\ThinkPHP\Thi...')
#11 {main}
回复讨论(解决方案)
你的 MySQL 没有启动,或没有加载 mysql 扩展
你可以试试127.0.0.1 有可能你loacalhost访问不了mysql。
问题已经解决了 谢谢