vendredi 3 avril 2015

Python variable in a sqlite query

so Im looking for the way to be able to compare what is in a python with something in a SQLite query.For example:



num = input ("enter a number")
cur.execute("SELECT a.Name,a.Number FROM Ads a WHERE a.Number = (num)") //part where it doesnt work
row = cur.fetchone()
while row:
print(row)
row = cur.fetchone()


This doesnt work. I dont know how to be able to compare content of a python variable with data in a SQLite database via a SQlite query.


Thank you


Aucun commentaire:

Enregistrer un commentaire