1.2.1562. ext/oci8¶
Extension ext/oci8.
OCI8 gives access Oracle Database 12c, 11g, 10g, 9i and 8i.
<?php
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
// Prepare the statement
$stid = oci_parse($conn, 'SELECT * FROM departments');
if (!$stid) {
$e = oci_error($conn);
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
// Perform the logic of the query
$r = oci_execute($stid);
if (!$r) {
$e = oci_error($stid);
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
// Fetch the results of the query
print '<table border='1'>' . PHP_EOL;
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
print '<tr>' . PHP_EOL;
foreach ($row as $item) {
print ' <td>' . ($item !== null ? htmlentities($item, ENT_QUOTES) : ' ') . '</td>' . PHP_EOL;
}
print '</tr>' . PHP_EOL;
}
print '</table>' . PHP_EOL;
oci_free_statement($stid);
oci_close($conn);
?>
See also Oracle OCI8 and Oracle.
1.2.1562.1. Specs¶
Short name |
Extensions/Extoci8 |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
With PHP 7.0 and more recent |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |