|
在\CodeIgniter\system\application\config\database.php我是这样配置数据库的:
$active_group = "default";
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "postgres";
$db['default']['password'] = "admin";
$db['default']['database'] = "postgresql";
$db['default']['dbdriver'] = "pgsql";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
在\CodeIgniter\system\application\controllers目录下我有db1.php文件内容如下:
<?php
class Db1 extends Controller{
function index(){
$this->load->database();
$query=$this->db->query("select name,pwd,email from users");
foreach ($query->result() as $row) {//返回对象数组
echo $row->name;
echo $row->pwd;
echo $row->email."<br>";
}
echo "Total Result==".$query->num_rows();
}
}
?>
但是运行的时候老是出现如下的报错显示:
A PHP Error was encountered
Severity: Warning
Message: require_once(D:\CodeIgniter/system/database/drivers/pgsql/pgsql_driver.php) [function.require-once]: failed to open stream: No such file or directory
Filename: database/DB.php
Line Number: 77
Fatal error: require_once() [function.require]: Failed opening required 'D:\CodeIgniter/system/database/drivers/pgsql/pgsql_driver.php' (include_path='.;C:\PHP\pear') in D:\CodeIgniter\system\database\DB.php on line 77
请高手帮忙解决?急呀!
[ 本帖最后由 zhuyaopeng 于 2007-10-26 11:08 编辑 ] |
|