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
Fatal error: Call to undefined method CI_DB_mysql_driver::where() in /scripts/htdocs/smartdox-libraries/smartdox/system/libraries/Session.php on line 201
CI's own session class is trying to use this function.
config/database.php
$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.
解决方案
Did you add the datamapper bootstrap to the bottom of your index.php file? This fixed my problem.