Guest User

Untitled

a guest
Oct 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "localhost";
  4. $username = "postgres";
  5. $password = "test123";
  6. $dbname = "testdb";
  7.  
  8. $conn = new PDO("pgsql:host=$servername;dbname=$dbname", $username, $password);
  9. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  10.  
  11. if(!$conn){
  12. echo "error in conn";
  13. } else {
  14. echo "success";
  15. }
  16.  
  17. ?>
Add Comment
Please, Sign In to add comment