Advertisement
Guest User

Untitled

a guest
May 21st, 2018
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. def login(username, password):
  2.     password = encode_password(username, password)
  3.     select_query = "SELECT id, username, balance, message FROM clients"
  4.     # Balance shouldn't be in the query above.
  5.     # Actully why the fuck does the above query exist?
  6.     cursor.execute(select_query)
  7.     select_query = "SELECT id, username, balance, message FROM clients \
  8.                    WHERE username = '%s' \
  9.                    AND password = '%s' LIMIT 1" % (username, password)
  10.  
  11.     cursor.execute(select_query)
  12.     user = cursor.fetchone()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement