You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
507B

  1. from models.database import db
  2. def get_users():
  3. cursor = db.cursor()
  4. query = ("SELECT userid, username from users")
  5. cursor.execute(query)
  6. users = cursor.fetchall()
  7. cursor.close()
  8. return users
  9. def match_user(username, password):
  10. cursor = db.cursor()
  11. query = ("SELECT userid, username from users where username = \"" + username +
  12. "\" and password = \"" + password + "\"")
  13. cursor.execute(query)
  14. user = cursor.fetchall()
  15. cursor.close()
  16. return user