Codeigniter:当前未加载数据库驱动程序 [英] Codeigniter: Database driver is not currently loaded

查看:76
本文介绍了Codeigniter:当前未加载数据库驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在带有mysql的wampserver 3中安装了codeigniter 3,并配置了与数据库的连接,并且一切正常,模型具有连接,查询正在返回数据,但是,当我使用探查器库时,特别是函数:

I got installed codeigniter 3 in a wampserver 3 with mysql, and the connection to the DB configured, and all is working well, models have connection and queries are returning data, however, when i'm using the profiler library, specially the function:

$this->output->enable_profiler(true);

返回以下内容:

It returns me the follow:

我只想查看已运行但显示的查询:

I just want to see the queries that were runned but is showing:


当前未加载数据库驱动程序

Database driver is not currently loaded

关于如何解决此问题的任何想法?就像探查器无法获得数据库已连接一样。
如果您需要更多信息,请问我。谢谢。

Any idea about how to solve this? It is like the profiler doesn't get that the DB is connected. If you need more information ask me about it and thanks.

推荐答案

首先,在autoload.php:

First of all this is completely necessary in the autoload.php:

 $autoload['libraries'] = array('database');

作为注释,Codeigniter不支持显示调用

And as annotation, Codeigniter doesn't support to show the queries runned when calling

$this->output->enable-profiler(true); 

如果在CI_Model或任何其他模型上加载数据库连接,则完全有必要加载数据库如果想查看运行的查询,可以通过控制器或主控制器进行连接。

if you load the database connection on the CI_Model or any other model, it is completelly necessary loading the database connection over the controllers or main controller if want to see the queries runned.

这篇关于Codeigniter:当前未加载数据库驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆