core_second/functions/functions.database.php
/********************************************
 * FUNCTIONS USED TO INTERACT WITH DATABASE *
 ********************************************/
FUNCTIONS USED TO INTERACT WITH DATABASE
FUNCTIONS USED TO INTERACT WITH DATABASE
function create_user($userid, $dbsocket)
{
  $query = 'SELECT id, login, mail, class, subclass, lastlogin, avatar
            FROM user
            WHERE id = \'' . $userid . '\'';
  $result = $dbsocket->query($query);
  $user = $result->fetch(PDO::FETCH_ASSOC);
  $user = new User($user['id'], $user['login'], $user['mail'], $user['class'], $user['subclass'], $user['lastlogin'], $user['avatar']);
  return $user;
}
function create_user ( $ userid , $ dbsocket ) { $ query = 'SELECT id, login, mail, class, subclass, lastlogin, avatar
            FROM user
            WHERE id = \'' . $ userid . '\'' ; $ result = $ dbsocket -> query ( $ query ) ; $ user = $ result -> fetch ( PDO :: FETCH_ASSOC ) ; $ user = new User ( $ user [ 'id' ] , $ user [ 'login' ] , $ user [ 'mail' ] , $ user [ 'class' ] , $ user [ 'subclass' ] , $ user [ 'lastlogin' ] , $ user [ 'avatar' ] ) ; return $ user ; }
FUNCTIONS USED TO INTERACT WITH DATABASE
FUNCTIONS USED TO INTERACT WITH DATABASE