Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(E_ALL);
  4.  
  5. echo "Hello!";
  6.  
  7. $dsn = "postgresql:host=db.doc.ic.ac.uk;port=5432;dbname=g1027121";
  8. $user = "g1027121_u";
  9. $password = "password";
  10.  
  11. $link = new PDO($dsn,$user,$password);
  12.  
  13. $stmt = $link -> prepare ("INSERT INTO cities (city_name, location_x, location_y) VALUES ('London', 0, 0);");
  14. echo "Prepared!";
  15. $stmt -> execute();
  16. echo "Executed!";
  17. var_dump($stmt -> fetchAll());
  18. $stmt -> closeCursor();
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement