Advertisement
Guest User

Untitled

a guest
Mar 4th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <?php
  2. // important! - to run this script in specific intervals - set task schedule/cron in windows
  3.  
  4. // Connection
  5. // ### FIREBIRD ###
  6. $db = "F:Data.gdb";
  7. $dbuser = "sysdba";
  8. $dbpass = "masterkey";
  9. $res = ibase_connect($db,$dbuser,$dbpass) or die("<br>" . ibase_errmsg());
  10.  
  11. // ### MYSQL ###
  12. $dbhost = "localhost";
  13. $dbname = "localhost_t1";
  14. $username = "root";
  15. $password = "";
  16.  
  17. try {
  18. $conn = new PDO("mysql:host=$dbhost;dbname=$dbname", $username, $password);
  19. // set the PDO error mode to exception
  20. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  21. print "Connected successfully";
  22. print "<br />";
  23. }
  24. catch(PDOException $e)
  25. {
  26. print "Connection failed: " . $e->getMessage();
  27. print "<br />";
  28. }
  29. // End of connection
  30.  
  31. // Query
  32. $sql="select * from WIZYTY";
  33.  
  34. $result=ibase_query($res,$sql) or die(ibase_errmsg());
  35.  
  36. while($row=ibase_fetch_object($result)){
  37.  
  38. print $row->WIZ_ID;
  39. print '<br />';
  40. }
  41. ibase_free_result($result);
  42. // End of Query
  43.  
  44. // Closing
  45. ibase_close($res) or die("<br>" . ibase_errmsg());
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement