Advertisement
Guest User

Untitled

a guest
May 6th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2. $database = '****';
  3. $user = '*****';
  4. $password = '******';
  5. $hostname = '********';
  6. $port = 50000;
  7.  
  8. $conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database;" .
  9. "HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP;UID=$user;PWD=$password;";
  10. $conn = db2_connect($conn_string, '', '');
  11.  
  12. if ($conn) {
  13. echo "Connection succeeded.";
  14. db2_close($conn);
  15. }
  16. else {
  17. echo "Connection failed.";
  18. }
  19. ?>
  20. $database = 'VARUN';
  21. $user = 'db2i1own';
  22. $password = 'ChangeM3DayCN!';
  23.  
  24. $conn = db2_connect($database, $user, $password);
  25.  
  26. if ($conn) {
  27. echo "Connection succeeded.";
  28. db2_close($conn);
  29. }
  30. else {
  31. echo "Connection failed.";
  32. }
  33. ?>
  34.  
  35. Call to undefined function db2_connect() in /home/s1.php on line 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement