It is easy to use MySQL database in CodeIgniter, as long as the application/config/database.php Configure the database name, account password to use.
It's a little tricky to change to SQLite, CodeIgniter by default the PHP5 comes with a driver to support SQLite and the driver only supports the SQLite 2.x version. Fortunately, since CodeIgniter 2.1 has built-in SQLite's PDO driver, through the PDO driver can achieve the support of sqlite3.
application/config/database.phpoptions in the editor:
$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;
This gives you direct access to the SQLite database.
The source of this article: Mango station
http://www.bkjia.com/PHPjc/363808.html www.bkjia.com true http://www.bkjia.com/PHPjc/363808.html techarticle It is easy to use MySQL database in CodeIgniter, as long as the database name and account password can be configured in application/config/database.php. Change to SQLite ...