您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

19 行
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