Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Spyder Editor
- This is a temporary script file.
- """
- import sqlite3
- conn = sqlite3.connect('OS_Employee.db')
- userEmail = "bob.moore@gmail.com"
- userPassword = "bob"
- with conn:
- cur = conn.cursor() #sends query to table "worker bee"
- try:
- selectQuery = "SELECT COUNT (*) FROM Employee WHERE (Email = '" + userEmail + "' AND Password = '" + userPassword + "')"
- cur.execute(selectQuery)
- results = cur.fetchone()
- #print(results[0])
- if results[0] == 1:
- print("Login successful")
- else:
- print("Login unsucessful")
- except:
- print("Connection failed")
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement