Guest User

Untitled

a guest
Dec 17th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. $db_connection = pg_connect("host=localhost dbname=postgres user=postgres password=postgres");
  4.  
  5. if ($db_connection) {
  6.  
  7. echo 'Connection attempt succeeded.';
  8.  
  9. } else {
  10.  
  11. echo 'Connection attempt failed.';
  12.  
  13. }
  14. ?>
  15.  
  16. $db_connection = pg_connect("
  17. host=localhost
  18. dbname=postgres
  19. user=postgres
  20. password=postgres
  21. ") or die('Could not connect:' . pg_last_error());
Add Comment
Please, Sign In to add comment