时间:2021-07-01 10:21:17 帮助过:13人阅读
9.编辑php代码连接测试oracle数据库
$conn = oci_connect('scott', 'oracle', '192.168.12.133/orcl');
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']);
exit;
}
$query = 'select ename,sal from scott.emp';
$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 '
| '.($item?htmlentities($item):' ').' | ';
本文出自 “不积跬步无以至千里” 博客,谢绝转载!
http://www.bkjia.com/PHPjc/477919.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477919.htmlTechArticlephp连接访问Oracle是用过oci函数,以下是整理的文档 1.安装Apache和php包 yum install -y httpd php* 2.下载Oracle组件 oracle-instantclient-basic-10.2.0.4-1.i386...