Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Datasite\Integration;
- class UsersDAO {
- public function __construct() {
- $conn = pg_connect('user=sem2 password=sem2');
- }
- public function signInUser($username, $password) {
- pg_prepare("", 'SELECT id, username FROM users WHERE username = $1 AND password = $2');
- $response = pg_execute("", array($username, $password));
- $row = pg_fetch_assoc($response);
- }
- public function signUpUser($username, $password) {
- pg_prepare("$conn", 'INSERT INTO users(username, password) VALUES ($1 , $2)');
- pg_execute("$conn", array($username, $password));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement