Hi,
When I use an integer as variable in my SQL query it works as it should. However if work with a string It does not work, I don't get an error message but also not results.
THis is the code that works (with variable as integer)
![[Image: bvkppsksrfavz.22.18.png]](https://www.mupload.nl/img/bvkppsksrfavz.22.18.png)
any tips on what I do wrong?
When I use an integer as variable in my SQL query it works as it should. However if work with a string It does not work, I don't get an error message but also not results.
THis is the code that works (with variable as integer)
import psycopg2 as p
conn = p.connect ("dbname='participants_db' user='postgres' host= 'localhost'")
cur = conn.cursor()
x = 5
cur.execute("UPDATE participants SET participant_paid = 'Yes' WHERE participant_id = '%s'", [x])
conn.commit()If I change the variable to a string and change my query to %%S instead of %, I don't get an error message but also no resultsx = ('Cleavon')
cur.execute("UPDATE participants SET participant_paid = 'Yes' WHERE participant_name = '%%s'", [x])![[Image: bvkppsksrfavz.22.18.png]](https://www.mupload.nl/img/bvkppsksrfavz.22.18.png)
any tips on what I do wrong?
