User.sql.php 1 KB
Newer Older
thibaut-felten's avatar
thibaut-felten committed
1 2 3
<?php

User::addSqlQuery('USER_LIST',
4
    'SELECT * FROM  USER ORDER BY USER_ID');
thibaut-felten's avatar
thibaut-felten committed
5 6

User::addSqlQuery('USER_GET_WITH_LOGIN',
7
    'SELECT * FROM USER WHERE USER_LOGIN=:login');
thibaut-felten's avatar
thibaut-felten committed
8 9

User::addSqlQuery('USER_CONNECT',
10 11 12 13 14 15
    'SELECT * FROM USER WHERE USER_LOGIN=:login and USER_PASSWORD=:password');

User::addSqlQuery('USER_BY_ID',
    'SELECT * FROM  USER WHERE USER_ID=:user_id');

User::addSqlQuery('USER_UPDATE',
thibaut-felten's avatar
thibaut-felten committed
16
    "UPDATE USER SET USER_LOGIN=:login, USER_EMAIL=:email, USER_LASTNAME=:lastname, USER_FIRSTNAME=:firstname, USER_ROCK=:rock, USER_SCISSORS=:scissors, USER_PAPER=:paper, USER_WIN=:win, USER_LOST=:lost WHERE USER_ID=:id");
17 18 19 20 21 22

User::addSqlQuery('USER_DELETE',
    "DELETE FROM USER WHERE USER_ID=:id");

User::addSqlQuery('USER_CREATE',
    "INSERT INTO USER (USER_ID, USER_LOGIN, USER_EMAIL, USER_ROLE, USER_PASSWORD, USER_FIRSTNAME, USER_LASTNAME) VALUES (NULL, :login, :email, :role, :password, :firstname, :lastname)");
23 24 25

User::addSqlQuery('USER_GET_GAMES',
    "SELECT GAME_ID FROM GAME_HISTO WHERE USER_ID=:USER_ID");