I have a table called "uid" which has two fields, rfid and empid:
- EXAMPLE RECORD 1 rfid = 88 999 33 555 empid = 1
- EXAMPLE RECORD 2 rfid = 64 344 77 222 empid = 2
I would like to run a query which stores all of these values in a python dictionary, and allows me to set the rfid number as a variable (MyRFID) to be called later in the script:
db = MySQLdb.connect("MyIp", "MyUser", "MyPass", "MyDB", cursorclass=MySQLdb.cursors.DictCursor)
curs=db.cursor()
curs.execute("""SELECT number, empid FROM rfid """)
So that later in the code I can check to see if I get a match from an existing variable:
if MyVariable == MyRFID:
#Create new record for that empid