Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dirtycajunrice/2161789b920abf6d8a3ffc6eb96d716b to your computer and use it in GitHub Desktop.
Save dirtycajunrice/2161789b920abf6d8a3ffc6eb96d716b to your computer and use it in GitHub Desktop.
def userexistcheck(username):
connection = sqlite3.connect(DB_REL_PATH)
c_db = connection.cursor()
c_db.execute("SELECT ? FROM users", (username,))
user = c_db.fetchone()
connection.close()
if user:
user_exist = True
else:
user_exist = False
return user_exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment