[英]Connecting to the database in a Created Library - CodeIgniter
I have a little issue right now and its bugging me, hopefully one of you guys will be able to help me out. 我现在有一个问题,它让我烦恼,希望你们其中一个人能够帮助我。
Basically I'm creating a library to use in CodeIgniter and I'm getting this error: 基本上我正在创建一个在CodeIgniter中使用的库,我收到此错误:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Functions::$db
Filename: libraries/Functions.php
Line Number: 11
The Database library is already on autoload aswell as my functions library: 数据库库已经在自动加载以及我的函数库中:
$autoload['libraries'] = array('database','session','encrypt','functions');
The Functions.php
file is located in the application/libraries
folder accordingly. Functions.php
文件相应地位于application/libraries
文件夹中。
Line number 11 consists of this: 第11行包括:
$this->db->where('username', $data);
Not sure as to why the db
is an undefined property? 不确定为什么db
是一个未定义的属性?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.