我连接到sqlite数据库并试图从表中获取数据。使用Codeigniter从sqlite数据库获取数据时出错
但其示出了某些错误,
致命错误:调用一个成员函数lastErrorCode()中d的非对象:\ XAMPP \ htdocs中\电子圣训\ SYSTEM \数据库\驱动\ sqlite3的\上线遇到300 甲PHP错误
严重性sqlite3_driver.php:错误
消息:调用一个成员函数lastErrorCode()非对象上
文件名:sqlite3的/ sqlite3_driver.php
行号:300
回溯:
下面是我的代码
{
$this->db->select("*");
$q=$this->db->get("chapter");
$r=$q->result();
echo "<pre>";print_r($r);exit;
$this->load->view('welcome_message');
}
$db['default'] = array(
'dsn' => '',
'hostname' => '',
'username' => '',
'password' => '',
'database' => 'sqlite:'.APPPATH.'/Database/data.db',
'dbdriver' => 'sqlite3',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => FALSE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
任何一个可以建议我?
你加载数据库? –
我正在使用db浏览器for sqlite @ManiKandan Kandan – sradha
我想你需要给数据库的主机名,用户名和密码 –