【发布时间】:2015-04-19 05:06:32
【问题描述】:
我在port:1525 上有一个数据库IP:10.21.30.178,其凭据为user:FUNREAD、pass:clock24 和service 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) : " ") . "</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
?>
但低于错误..
致命错误:在第 4 行调用 C:\xampp\htdocs\bkash\pending.php 中未定义的函数 oci_connect()
【问题讨论】: