Skip to content
Permalink
a6013384f5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
26 lines (22 sloc) 753 Bytes
import sqlite3 as sql
mydb = sql.connect("jawaraDB")
c = mydb.cursor()
def CheckLogin(username, password):
c.execute("""SELECT Username FROM tblUsers""")
values = c.fetchall()
validUser = False
valid = False
for i in values:
if i[0][:] == username:
validUser = True
user = i[0][:]
if validUser:
c.execute("""SELECT Password FROM tblUsers WHERE Username = '{0}'""".format(user))
userPassword = c.fetchone()
if password == userPassword[0][:]:
valid = True
return valid
def CheckJob(username):
c.execute("""SELECT Job FROM tblUsers WHERE Username = '{0}'""".format(username))
job = c.fetchone()
return job