Use the sqlite3 database in Codeigniter. It is easy to use the mysql database in Codeigniter. you only need to configure the database name and account password in applicationconfigdatabase. php. Changing to sqlite makes it easy to use mysql databases in Codeigniter.
application/config/database.php
You can use it after configuring the database name and account password.
It is a little troublesome to change to sqlite. Codeigniter uses the PHP5 built-in driver by default to support sqlite and this driver only supports sqlite 2.x. Fortunately, the pdo driver of sqlite has been built into Codeigniter 2.1, and sqlite3 can be supported through the pdo driver.
Editapplication/config/database.php
Options in:
$db['default']['hostname'] = 'sqlite:' . FCPATH . '../db/tms.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;
In this way, you can directly access the sqlite database.
Source: Mango Xiaozhan
Codeigniter is easy to use mysql databases. you only need to configure the database name and account password in application/config/database. php. Change to sqlite...