mirror of
https://github.com/twisterarmy/cloud-server.git
synced 2025-09-14 06:42:25 +00:00
implement addUser method
This commit is contained in:
parent
ca02840074
commit
c7252261c0
@ -18,4 +18,22 @@ class ModelUser extends Model {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addUser(int $blockId, int $userName) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$query = $this->_db->prepare("INSERT INTO `user` SET `blockId` = ?,
|
||||||
|
`userName` = ?");
|
||||||
|
|
||||||
|
$query->execute([$blockId, $userName]);
|
||||||
|
|
||||||
|
$this->_db->lastInsertId();
|
||||||
|
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
|
||||||
|
trigger_error($e->getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user