Advertisement
Guest User

Untitled

a guest
Oct 31st, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. PHP Fatal error: Call to a member function query() on resource ... on line 17.
  2.  
  3. <?php
  4. $DB = '//DBGOESHERE:PORT/SIDHERE';
  5. $DB_USER = '****';
  6. $DB_PASS = '****';
  7.  
  8. $conn = oci_connect($DB_USER, $DB_PASS, $DB);
  9.  
  10. //check for errors
  11. if (!$conn)
  12. {
  13. $e = oci_error();
  14. print htmlentities($e['message']);
  15. exit;
  16. }
  17.  
  18. $sql = "select display_name, last_export_file, last_export_date from schema.ms_export where last_export_date > sysdate -1 order by last_export_date desc";
  19. $stid = oci_parse($conn, $sql);
  20. oci_execute($stid);
  21. while (oci_fetch($stid)) {
  22. echo oci_result($stid, 'display_name') . " | ";
  23. echo oci_result($stid, 'last_export_file') . " | ";
  24. echo oci_result($stid, 'last_export_date') . "<br>n";
  25. }
  26. oci_free_statement($stid);
  27. oci_close($conn);
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement