-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoracletest.php
More file actions
32 lines (32 loc) · 928 Bytes
/
oracletest.php
File metadata and controls
32 lines (32 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/local/bin/php
<?php
// Create connection to Oracle
$connection = oci_connect($username = 'anrivera', $password = '$MarkusS4301!', $connection_string = '//oracle.cise.ufl.edu/orcl');
if (!$connection) {
$m = oci_error();
echo $m['message'], "\n";
exit;
}
else {
print "Sucessfully connected to Oracle!\n";
}
// Test functions
// $test = oci_parse($connection, 'SELECT name FROM customer');
// oci_execute($test);
// while(oci_fetch($test)){
// echo oci_result($test, 'NAME');
// echo "\n";
// }
// print "<table border='1'>\n";
// while ($row = oci_fetch_array($test, OCI_ASSOC+OCI_RETURN_NULLS)) {
// print "<tr>\n";
// foreach ($row as $item) {
// print " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>\n";
// }
// print "</tr>\n";
// }
// print "</table>\n";
// Close the Oracle connection
oci_free_statement($test);
oci_close($connection);
?>