|
我的数据库配置
PHP复制代码
$db['sqlite_db'] = array(
'dsn' => '',
'hostname' => '',
'username' => '',
'password' => '',
'database' => realpath("./sqlite.db"),
'dbdriver' => 'sqlite',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
复制代码
C
PHP复制代码
$dbA = $this->load->database('sqlite_db', TRUE);
$a=$dbA->query("select * from user");
print_r($db);
复制代码
报错: Call to undefined function sqlite_open() in
网上查的时候看到有可能是php配置问题。我的phpinfo:
PDOPDO support | enabled | PDO drivers | mysql, sqlite |
pdo_sqlitePDO Driver for SQLite 3.x | enabled | SQLite Library | 3.7.7.1
|
sqlite3SQLite3 support | enabled | SQLite3 module version | 0.7 | SQLite Library | 3.7.7.1 |
Directive | Local Value | Master Value | sqlite3.extension_dir | no value | no value
|
各位老师多帮忙~ 谢谢
|
|