CodeIgniter Forums
Error in Database Configuration - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Error in Database Configuration (/showthread.php?tid=52264)



Error in Database Configuration - El Forum - 06-04-2012

[eluser]npCoda[/eluser]
Hello!
I am beginner for CI so don't have good knowledge.
My problem is:
I am not using any database. All the records are fetched from JSON.
Therefore I don't think I need to configure database...
As said by CI, CI doesn't necessarily ask for database.

So my database.php configuration is :

Quote:$active_group = 'default';
$active_record = FALSE;

$db['default']['hostname'] = '';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

It works in my local system but doesn't work in live server. I am so surprised.

Then I provided hostname, username, password and dbdriver, it works.
My question is that, is that necessary to provide all the details if I am not using database?

Thank you for your suggestion.


Error in Database Configuration - El Forum - 06-04-2012

[eluser]TWP Marketing[/eluser]
Check your autoload.php file in the config folder.
You may be loading the database driver and don't need it.
Code:
/*
| -------------------------------------------------------------------
|  Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your application/libraries folder.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/

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



Error in Database Configuration - El Forum - 06-04-2012

[eluser]CroNiX[/eluser]
Also, make sure your session config isn't set to use databases, because if it is it will load the database even if you don't tell it to anywhere else whenever the session library is loaded.