UserModel.inc 258 B

123456789
  1. <?php
  2. class UserModel {
  3. public function getIdFromUsername($username) {
  4. $sql = sprintf("SELECT user_id FROM users WHERE username = '%s'", $username);
  5. $database = new Database();
  6. $userData = $database->query($sql);
  7. return $userData[0]['user_id'];
  8. }
  9. }