Reputation: 2485
Possible Duplicate: Problem with database in CodeIgniter
Alright, I've googled this the last two days to no avail. I'm received a few hits from SO and codeigniter's support forums and they're mostly misleading threads and "oops" mistakes by other people. I actually have two questions, but one I can hold onto for the sake of solving this mind boggler.
My Setup:
Alright so,
I added the following line to my "welcome" controller, before the view gets loaded. CodeIgniter spits out the "Unable to load the requested class: database". I tried "Database" too, same thing.
$this->load->library('database');
I've tried $autoload['libraries'] = array('database');
which yields a blank page.
$autoload['libraries'] = array('Database');
which yields the preview page as seen in #1. error_reporting(E_ALL)
above the inline load from the welcome controller and nothing else showed up.I can only come to blame my inexperience with IIS that could be causing the issue.
EDIT: So, #1 has been fixed, auto-loading database, and, thanks to Ben, I had forgotten about "load->database(...)
" method...
Anyway, my current error now is just a white page when the database is loaded via autoload. My code is just set to autoload the database and display the default view provided with CodeIgniter. Removing the database autoload causes the view to show...
Upvotes: 1
Views: 2583
Reputation: 2021
Just a follow up to anyone having this same issue (including my future self).
Make sure that whichever dbdriver you are loading in your database config has the correct library (dll or so) loaded in php.ini
$db['default']['dbdriver'] = 'mysqli'; //MySQLi <-- mysqli.dll
$db['default']['dbdriver'] = 'mysql'; //MySQL <-- mysql.dll
$db['default']['dbdriver'] = 'pdo'; //PDO <-- pdo.dll
Failure to load the correct dll will cause CodeIgniter to fail with a blank page.
Upvotes: 1