Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // connect ke oracle xe pakai easy naming
- $conn = oci_connect('hr', 'hr', '//localhost/xe');
- if (!$conn) {
- $e = oci_error();
- trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
- }
- // execute query
- $stid = oci_parse($conn, 'select * from employees');
- oci_execute($stid);
- // tampilkan data
- echo "<table border='1'>\n";
- while ($row = oci_fetch_assoc($stid)) {
- echo "<tr>\n";
- foreach ($row as $item) {
- echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>\n";
- }
- echo "</tr>\n";
- }
- echo "</table>\n";
- ?>
Add Comment
Please, Sign In to add comment