user permission
This commit is contained in:
parent
1da89502ee
commit
c0cfbd7df8
3 changed files with 5 additions and 4 deletions
|
@ -40,8 +40,8 @@ class Users{
|
||||||
function create(){
|
function create(){
|
||||||
|
|
||||||
$stmt = $this->conn->prepare("
|
$stmt = $this->conn->prepare("
|
||||||
INSERT INTO ".$this->itemsTable."(`id`, `firstname`, `lastname`, `email`, `password`, `country`, `birthdate`)
|
INSERT INTO ".$this->itemsTable."(`id`, `firstname`, `lastname`, `email`, `password`, `country`, `birthdate`, `permission`)
|
||||||
VALUES(?,?,?,?,?,?,?)");
|
VALUES(?,?,?,?,?,?,?,'user')");
|
||||||
|
|
||||||
$this->id = htmlspecialchars(strip_tags($this->id));
|
$this->id = htmlspecialchars(strip_tags($this->id));
|
||||||
$this->firstname = htmlspecialchars(strip_tags($this->firstname));
|
$this->firstname = htmlspecialchars(strip_tags($this->firstname));
|
||||||
|
|
|
@ -29,7 +29,8 @@ if($result->num_rows > 0){
|
||||||
"email" => $email,
|
"email" => $email,
|
||||||
"password" => $password,
|
"password" => $password,
|
||||||
"country" => $country,
|
"country" => $country,
|
||||||
"birthdate" => $birthdate
|
"birthdate" => $birthdate,
|
||||||
|
"permission" => $permission
|
||||||
);
|
);
|
||||||
array_push($itemRecords["items"], $itemDetails);
|
array_push($itemRecords["items"], $itemDetails);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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`)
);
|
Loading…
Reference in a new issue