【问题标题】:Oracle database Connection issue in phpphp中的Oracle数据库连接问题
【发布时间】:2015-04-19 05:06:32
【问题描述】:

我在port:1525 上有一个数据库IP:10.21.30.178,其凭据为user:FUNREADpass:clock24service name:DRFUNPD1

我正在尝试从我的机​​器 (10.21.30.220) 连接并编写以下代码进行连接。

<?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";

?>

但低于错误..

致命错误:在第 4 行调用 C:\xampp\htdocs\bkash\pending.php 中未定义的函数 oci_connect()

【问题讨论】:

标签: php oracle


【解决方案1】:

根据fatail错误信息,您没有安装OCI8扩展:

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

【讨论】:

    猜你喜欢
    • 2017-12-19
    • 1970-01-01
    • 2018-03-09
    • 1970-01-01
    • 2019-12-30
    • 1970-01-01
    • 1970-01-01
    • 2011-09-12
    • 1970-01-01
    相关资源
    最近更新 更多