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
- <?php
- $conn = oci_connect('username', 'password', 'dbname');
- if (!$conn) {
- $e = oci_error();
- print htmlentities($e['message']);
- exit;
- }
- $query = 'select a.title, a.id_number, a.creation_time from sa.table_case';
- $stid = oci_parse($conn, $query);
- if (!$stid) {
- $e = oci_error($conn);
- print htmlentities($e['message']);
- exit;
- }
- $r = oci_execute($stid, OCI_DEFAULT);
- if (!$r) {
- $e = oci_error($stid);
- echo htmlentities($e['message']);
- exit;
- }
- print '<table border="1">';
- while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
- print '<tr>';
- foreach ($row as $item) {
- print '<td>'.($item?htmlentities($item):' ').'</td>';
- }
- print '</tr>';
- }
- print '</table>';
- oci_close($conn);
- ?>