Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to undefined method CI_DB_mysql_driver::where()
#1

[eluser]Webnet[/eluser]
I just upgraded my version of CodeIgniter... I went through the config files and copied over any values that weren't in my existing configuration but were inside the new config files. I'm running into an error where Active Record isn't working and I'm unsure why. I'm trying to debug and trace it back to a problem within the code but am struggling. Any ideas on what I should do? My error is

Code:
Fatal error: Call to undefined method CI_DB_mysql_driver::where() in /scripts/htdocs/site/system/libraries/Session.php on line 201

CI's own session class is trying to use this function.

config/database.php

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = CPOD_DATABASE_SERVER;
$db['default']['username'] = CPOD_DATABASE_USER;
$db['default']['password'] = CPOD_DATABASE_PASSWORD;
$db['default']['database'] = CPOD_DATABASE;
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

After initial investigation it looks like having a "database" object loaded into CI's library auto load causes a DB object loaded with the $active_record value pulling in false.
#2

[eluser]smily[/eluser]
I'm also getting same error
Code:
Fatal error: Call to undefined method CI_DB_mysql_driver::where() in /scripts/htdocs/smartdox-libraries/smartdox/system/libraries/Session.php on line 201
Can any one say whats exact solution for this problem.

Thanks in advance.
#3

[eluser]Unknown[/eluser]

I fixed a similar error by setting the $active_record variable to TRUE in the database.php config file.

As stated here: http://ellislab.com/codeigniter/user-gui...ation.html

"Note: that some CodeIgniter classes such as Sessions require Active Records be enabled to access certain functionality."




Theme © iAndrew 2016 - Forum software by © MyBB