Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. Spyder Editor
  4.  
  5. This is a temporary script file.
  6. """
  7.  
  8.  
  9. import sqlite3
  10. conn = sqlite3.connect('OS_Employee.db')
  11. userEmail = "bob.moore@gmail.com"
  12. userPassword = "bob"
  13.  
  14. with conn:
  15. cur = conn.cursor() #sends query to table "worker bee"
  16. try:
  17. selectQuery = "SELECT COUNT (*) FROM Employee WHERE (Email = '" + userEmail + "' AND Password = '" + userPassword + "')"
  18. cur.execute(selectQuery)
  19. results = cur.fetchone()
  20. #print(results[0])
  21. if results[0] == 1:
  22. print("Login successful")
  23. else:
  24. print("Login unsucessful")
  25. except:
  26. print("Connection failed")
  27. conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement