$oraUser="scott";
$oraPass="oracle";
$oraDB="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.5.4.160)(PORT=1521)))(CONNECT_DATA=(SID=MINI)))";
$Conn = ocilogon($oraUser,$oraPass,$oraDB) or die( "ORACLE server未启动,请与系统管理员联系.");
$stmt = OCIParse($Conn,"select empno,ename from emp");
/* 使用 OCIDefineByName 要在执行 OCIExecute 前 */
OCIDefineByName($stmt,"EMPNO",&$empno);
OCIDefineByName($stmt,"ENAME",&$ename);
OCIExecute($stmt);
?>
while (OCIFetch($stmt)) {
?>
echo "empno:$empno"; ?>
|
echo "ename:$ename"; }?>
|
OCIFreeStatement($stmt);
OCILogoff($Conn);
?>
阅读(1399) | 评论(0) | 转发(0) |