Feb-28-2019, 04:59 PM
Hi
I am trying to make a script who should look up some stuff in a database but i cant make it work.
The problem is i need to check two variables against the db to get a return match. So when i use one variable i works but when i use "AND" and two variables i get an error i cant understand.
here is the code.
This is the error when i use datum=? and date. This error goes away when i remove them.
I am trying to make a script who should look up some stuff in a database but i cant make it work.
The problem is i need to check two variables against the db to get a return match. So when i use one variable i works but when i use "AND" and two variables i get an error i cant understand.
here is the code.
1 2 3 4 |
c.execute( 'SELECT * FROM tider WHERE Namn=? AND datum=?' , [namn, date]) data = c.fetchall() for row in data: version = (row[ 3 ]) |
Error:Traceback (most recent call last):
File "C:\Users\xzenon\Desktop\Ny mapp\timecalculon.py", line 23, in <module>
print (version)
NameError: name 'version' is not defined