遇到同样的问题,参考了网上的资料如下: 
1、win2003下,apache + php 访问oracle 
参考文档 http://database.ctocio.com.cn/tips/197/6463197.shtml   相关的库文件下载地址: http://eduunix.ccut.edu.cn/index2/database/Oracle%20Instant%20Client/ http://eduunix.ccut.edu.cn/index2/database/Oracle%20Instant%20Client/instantclient-basic-win32-10.1.0.5-20060419.zip   2、实现CI访问Oracle Active Record不能支持 Oracle,参考 《PHP敏捷开发框架》 “dbdriver: 你正在使用的数据库的类型 - CI可受的有选项有MySQL、MySQLi、 Postgre SQL、ODBC和MS SQL ”  
 
 因此采用链接串方式访问: controllers中: function index() 
 { 
  $data['title'] = "My Blog Title"; 
  $data['heading'] = "My Blog Heading"; 
  $conn = OCILogon("username", "password", '//0.0.0.0:1521/xxxx');//最后的串表示oracle服务器的地址和端口号,斜线后面表示服务(库)名 
  $query = "select user_id,user_date from table_name where user_id = 8 and user_name = 'Leonwang'"; 
  $stid = OCIParse($conn, $query); 
  OCIExecute($stid); 
  $i = 0; 
  while ($row = oci_fetch_array ($stid, OCI_BOTH)) {//此处可以参考php帮助 oci_fetch_array 
   $results[$i]['USER_ID'] = $row['USER_ID']; 
   $results[$i][USER_DATE'] = $row[USER_DATE']; 
   $i++; 
  } 
  echo $i. '<br>';//取出记录数 
  $data['query'] = $results; 
  $this->load->view('ebs_helper_view',$data);//调用view  
 } 
---------------------------- 
view : 
<html> 
<head> 
<title><?php echo $title; ?></title> 
</head> 
<body> 
<h1><?php echo $heading; ?></h1> 
<?php  
foreach($query as $row):  
?> 
<h3><?=$row['USER_ID']?><h3> 
<p><?=$row['USER_DATE']?><p> 
<hr> 
<? endforeach; ?> 
</body> 
</html> 
 
 |