user permission

This commit is contained in:
Page Asgardius 2022-10-01 08:46:01 -07:00
parent 1da89502ee
commit c0cfbd7df8
3 changed files with 5 additions and 4 deletions

View file

@ -40,8 +40,8 @@ class Users{
function create(){
$stmt = $this->conn->prepare("
INSERT INTO ".$this->itemsTable."(`id`, `firstname`, `lastname`, `email`, `password`, `country`, `birthdate`)
VALUES(?,?,?,?,?,?,?)");
INSERT INTO ".$this->itemsTable."(`id`, `firstname`, `lastname`, `email`, `password`, `country`, `birthdate`, `permission`)
VALUES(?,?,?,?,?,?,?,'user')");
$this->id = htmlspecialchars(strip_tags($this->id));
$this->firstname = htmlspecialchars(strip_tags($this->firstname));

View file

@ -29,7 +29,8 @@ if($result->num_rows > 0){
"email" => $email,
"password" => $password,
"country" => $country,
"birthdate" => $birthdate
"birthdate" => $birthdate,
"permission" => $permission
);
array_push($itemRecords["items"], $itemDetails);
}

View file

@ -1 +1 @@
CREATE TABLE `users` ( `id` varchar(15) NOT NULL, `firstname` varchar(30) NOT NULL, `lastname` varchar(30) NOT NULL, `email` varchar(30) NOT NULL, `password` varchar(30) NOT NULL, `country` varchar(30) NOT NULL, `birthdate` date NOT NULL, UNIQUE KEY `id` (`id`) );
CREATE TABLE `users` ( `id` varchar(15) NOT NULL, `firstname` varchar(30) NOT NULL, `lastname` varchar(30) NOT NULL, `email` varchar(30) NOT NULL, `password` varchar(30) NOT NULL, `country` varchar(30) NOT NULL, `birthdate` date NOT NULL, `permission` varchar(5) NOT NULL, UNIQUE KEY `id` (`id`) );