Reputation: 496
I am using sqlite for the first time and so I am having problems in configuring it with codeigniter 2.2.
I have put my sqlite database in:- application/config/sqlite/sqlite-database.db
and my configuration is:-
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = 'sqlite/sqlite-database.db';
$db['default']['dbdriver'] = 'sqlite';
$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;
I am not able to connect to database
Upvotes: 0
Views: 5058
Reputation:
try with something like this:
$db['default']['hostname'] = 'sqlite:'.APPPATH.'config/sqlite/sqlite-database.db';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'pdo';
$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;
Upvotes: 5
Reputation: 496
I faced one more problem for which I got the solution at:- CodeIgniter Sqlite not working
I am sharing this because many of you would face this problem while using codeigniter and sqlite
Upvotes: 0