Guest User

Untitled

a guest
Jul 16th, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1.     public function add(User $user)
  2.     {
  3.         //On prépare la requête
  4.         $req = $this->db->prepare('INSERT INTO users SET username = :name, password = :pass, mail = :mail, credits = 500000,
  5.                                   last_offline = :last_off, account_created = :account_c, ip_reg = :ip, ip_last = :ip_l');
  6.        
  7.         //On je ne sais pas quoi
  8.         $req->bindValue('name'      , $user->username());
  9.         $req->bindValue('password'  , $user->password());
  10.         $req->bindValue('mail'      , $user->email());
  11.         $req->bindValue('last_off'  , Engine::LightDate('complete'));
  12.         $req->bindValue('account_c' , Engine::LightDate('hc'));
  13.         $req->bindValue('ip'        , $_SERVER['REMOTE_ADDR']);
  14.         $req->bindValue('ip_l'      , $_SERVER['REMOTE_ADDR']);
  15.        
  16.         //On execute
  17.         $req->execute();
  18.     }
Add Comment
Please, Sign In to add comment