| 91 | } |
| 92 | |
| 93 | public function createUser(string $username, string $password_hash) |
| 94 | { |
| 95 | $stmt = $this->pdo->prepare( |
| 96 | 'INSERT INTO users (username, password_hash, created_at, updated_at) |
| 97 | VALUES (:username, :password_hash, :created_at, :updated_at)' |
| 98 | ); |
| 99 | $date = date('Y-m-d H:i:s'); |
| 100 | $stmt->execute([ |
| 101 | ':username' => $username, |
| 102 | ':password_hash' => $password_hash, |
| 103 | ':created_at' => $date, |
| 104 | ':updated_at' => $date, |
| 105 | ]); |
| 106 | return $this->pdo->lastInsertId(); |
| 107 | } |
| 108 | |
| 109 | public function deleteUser(int $user_id) |
| 110 | { |