By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,510 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,510 IT Pros & Developers. It's quick & easy.

Using WAMP - I cannot connect to Oracle

100+
P: 154
Using WAMP - I cannot connect to Oracle.

I enabled the oci and oracle extension. and running php runs fine but when trying to do a connection to oracle i get this error.

Fatal error: Call to undefined function oci_connect() in D:\wamp\www\oracle.php on line 3

Could somebody please help me this issue.

This is the connection script i am trying to use.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.   $conn = oci_connect('username', 'password', 'dbname');
  4.   if (!$conn) {
  5.     $e = oci_error();
  6.     print htmlentities($e['message']);
  7.     exit;
  8.   }
  9.  
  10.   $query = 'select a.title, a.id_number, a.creation_time from sa.table_case';
  11.  
  12.   $stid = oci_parse($conn, $query);
  13.   if (!$stid) {
  14.     $e = oci_error($conn);
  15.     print htmlentities($e['message']);
  16.     exit;
  17.   }
  18.  
  19.   $r = oci_execute($stid, OCI_DEFAULT);
  20.   if (!$r) {
  21.     $e = oci_error($stid);
  22.     echo htmlentities($e['message']);
  23.     exit;
  24.   }
  25.  
  26.   print '<table border="1">';
  27.   while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
  28.     print '<tr>';
  29.        foreach ($row as $item) {
  30.          print '<td>'.($item?htmlentities($item):'&nbsp;').'</td>';
  31.        }
  32.        print '</tr>';
  33.   }
  34.   print '</table>';
  35.  
  36.   oci_close($conn);
  37. ?>
Jun 11 '07 #1
Share this Question
Share on Google+
3 Replies


epots9
Expert 100+
P: 1,351
do u have the latest extensions enabled?
Jun 11 '07 #2

100+
P: 154
Yes I got the oracle and OCI enabled.

do u have the latest extensions enabled?
Jun 11 '07 #3

P: 1
All that you need to do is, copy the OCI.dll in the path, where you have instaled apache and php in my case is

C:\wamp\bin\apache\Apache2.2.11\bin and

C:\wamp\bin\php\php5.3.0

restart your apache server , and enjoy

regards
jorge
Nov 20 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.