0

I have a database IP:10.21.30.178 on port:1525 with credentials user:FUNREAD, pass:clock24 and service name:DRFUNPD1.

I am trying to connect from my machine(10.21.30.220) and writing below code to connect.

<?php

    // Connects to the XE service (i.e. database) on the "localhost" machine
    $conn = oci_connect('FUNREAD', 'clock24', '10.6.8.51:1525/DRFUNPD1');
    if (!$conn) {
        $e = oci_error();
        trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
    }

    $stid = oci_parse($conn, 'SELECT * FROM employees');
    oci_execute($stid);

    echo "<table border='1'>\n";
    while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
        echo "<tr>\n";
        foreach ($row as $item) {
            echo "    <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) :    "&nbsp;") . "</td>\n";
        }
        echo "</tr>\n";
    }
    echo "</table>\n";

?>

but getting below error..

Fatal error: Call to undefined function oci_connect() in C:\xampp\htdocs\bkash\pending.php on line 4

Choxx
  • 945
  • 1
  • 24
  • 46
Basudev
  • 155
  • 5
  • 13
  • Check http://stackoverflow.com/questions/8635881/fatal-error-call-to-undefined-function-oci-connect , And http://stackoverflow.com/questions/22478387/call-to-undefined-function-oci-connect – Pratik Joshi Apr 19 '15 at 05:17

1 Answers1

0

According to the fatail error message, you don't have the OCI8 extension installed:

http://php.net/manual/en/oci8.installation.php

Chris Lam
  • 3,526
  • 13
  • 10