conn = sqlite3.connect('SADS.db')
cur = conn.cursor()
print " "
choice = raw_input("Does the Customer know their user ID? Y/N : ")
if choice == "N":
number = raw_input("What is their phone number? : ")
cur.execute("SELECT * FROM customers WHERE Telephone = (?)", (number,))
row = cur.fetchone()
print "Customer ID : " , row[0]
I use the code above in order to retrieve customer details - but i get the following error when i do it :
File "G:\ICT\SADS.py", line 111, in editdetails
print "Customer ID : " , row[0]
TypeError: 'NoneType' object has no attribute '__getitem__'
and its really getting on my nerves ive tried using while loops or for row in rows yet it does not work - please help :(