CodeIgniter Forums

Full Version: SQLite Configuration on Windows 7
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Coeigniter version 2.0.2
Platform Windows 7 sp1

I have just started codeigniter development and would like to know how to configure Codeigniter for SQLite access.

I have read a number of posts on the web, but they seem to target version 1.72 of codeigniter.

Any help to get me started would be useful.


El Forum

For the basic stuff check out these vids on Youtube

Im not too sure but maybe there hasnt been any change to syntax from 1.72 to 2.02 for SQLLite implementation so maybe try those examples. I used some 1.7.2 tutorials and the only thing that was different was extending classes which instead of e.g. "Controller" it is now "CI_Controller" or "CI_Helper" etc.

Im quite new here so that is all I can advise, also check out the nettus videos by Jeffrey Way they are great too.

Also post as many questions as you can this is a really nice and helpful community. Smile

Im using PHP 5.0.5 on XAMPP incase that is any help to you and I have had not problems with that and CodeIgniter.

El Forum

Thank you for responding.

I did tryout the examples but they did not work.

Below is my modified database.php file:

$active_group = 'SQLite';
$active_record = TRUE;

$db['SQLite']['hostname'] = 'localhost';
$db['SQLite']['username'] = '';
$db['SQLite']['password'] = '';
$db['SQLite']['database'] = 'sqlite:C:\Users\polar\SQLiteDatabase';
$db['SQLite']['dbdriver'] = 'sqlite';
$db['SQLite']['dbprefix'] = '';
$db['SQLite']['pconnect'] = TRUE;
$db['SQLite']['db_debug'] = TRUE;
$db['SQLite']['cache_on'] = FALSE;
$db['SQLite']['cachedir'] = '';
$db['SQLite']['char_set'] = 'utf8';
$db['SQLite']['dbcollat'] = 'utf8_general_ci';
$db['SQLite']['swap_pre'] = '';
$db['SQLite']['autoinit'] = TRUE;
$db['SQLite']['stricton'] = FALSE;

Notice that I am not referencing the pdo_sqlite driver, but the codeigniter sqlite driver, is this a mistake?

Also, I have used the full path to the sqlite database file, should I have added the actual database I want to access. The tutorials I've seen ony state the PATH to the DB file.

Feedback welcomed.


El Forum

I think for "database" you should put the name of your database

Also try "root" for username and password.

Heres my one for MySQL

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'midas1';
$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;

Sorry I cant be more of a help, good luck Smile