Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2. $conn = oci_connect('hr', 'welcome', 'MYDB');
  3. if (!$conn) {
  4. $e = oci_error();
  5. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  6. }
  7.  
  8. $stid = oci_parse($conn, 'SELECT * FROM employees');
  9. oci_execute($stid);
  10.  
  11. echo "<table border='1'>n";
  12. while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
  13. echo "<tr>n";
  14. foreach ($row as $item) {
  15. echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : "") . "</td>n";
  16. }
  17. echo "</tr>n";
  18. }
  19. echo "</table>n";
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement