ユーザ
This commit is contained in:
@@ -31,5 +31,21 @@ User
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
public function
|
||||
insert ():
|
||||
Self
|
||||
{
|
||||
$sql = "
|
||||
INSERT INTO
|
||||
users (name, pass)
|
||||
VALUES ('{$this -> name}', '{$this -> pass}')";
|
||||
$GLOBALS['__db_connection'] -> query ($sql)
|
||||
or die ("db_insert error $sql");
|
||||
|
||||
$this -> id = $GLOBALS['__db_connection'] -> insert_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user