Welcome Guest, Not a member yet? Register   Sign In
Error in Database Configuration
#1

[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.
#2

[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');
#3

[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.




Theme © iAndrew 2016 - Forum software by © MyBB