<?php
$conn=OCILogon("Raju", "Password", "DATABASE_NAME");
if ( ! $conn ) {
echo "无法连接: " . var_dump( OCIError() );
die();
}
$query = "SELECT * FROM Company";
$result = OCIParse($conn, $query);
OCIExecute($result, OCI_DEFAULT);
while (OCIFetchInto ($result, $row, OCI_ASSOC)) {
if (OCIcolumnisnull($result, 'CompanyName')) {
print ( "<P>" . $row['CompanyID'] . "--->" . "公司名称未找到!! " . "<P>" );
}
else {
print ("<P>" . $row['CompanyID'] . "--->" . $row['CompanyName'] . "<P>" );
}
}
OCILogoff($conn);
?>