|
请教高手,在ci框架中怎么配置 sqlite 数据库
刚下载的ci版本: CodeIgniter_2.1.0
sqlite 数据库版本: 3.7.8
数据库放在项目根目录下的database 目录下面
ci/database/db.sdb
目前的配置
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = realpath('./database/db.sdb');
$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;
配置完后,运行报
( ! ) Fatal error: [] operator not supported for strings in E:\wamp\www\ci\system\database\DB_driver.php on line 1183
Call Stack
# Time Memory Function Location
1 0.0006 384936 {main}( ) ..\index.php:0
2 0.0017 457912 require_once( 'E:\wamp\www\ci\system\core\CodeIgniter.php' ) ..\index.php:202
3 0.0231 1361688 Hello->__construct( ) ..\CodeIgniter.php:308
4 0.0231 1361688 CI_Controller->__construct( ) ..\hello.php:9
5 0.0265 1625424 CI_Loader->initialize( ) ..\Controller.php:51
6 0.0266 1626576 CI_Loader->_ci_autoloader( ) ..\Loader.php:152
7 0.0273 1628264 CI_Loader->database( ) ..\Loader.php:1171
8 0.0279 1663848 DB( ) ..\Loader.php:346
9 0.0356 2515408 CI_DB_driver->initialize( ) ..\DB.php:148
10 0.0357 2515408 CI_DB_sqlite_driver->db_pconnect( ) ..\DB_driver.php:115
11 0.0374 2547936 CI_DB_driver->display_error( ) ..\sqlite_driver.php:91
|
|