Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Datasite\Integration;
  4.  
  5. class UsersDAO {
  6.  
  7. public function __construct() {
  8. $conn = pg_connect('user=sem2 password=sem2');
  9. }
  10.  
  11. public function signInUser($username, $password) {
  12. pg_prepare("", 'SELECT id, username FROM users WHERE username = $1 AND password = $2');
  13. $response = pg_execute("", array($username, $password));
  14. $row = pg_fetch_assoc($response);
  15. }
  16.  
  17. public function signUpUser($username, $password) {
  18. pg_prepare("$conn", 'INSERT INTO users(username, password) VALUES ($1 , $2)');
  19. pg_execute("$conn", array($username, $password));
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement