But you are trying to get rows with id = "f1", not rows with id = "789" - you have no variable substitution/expansion in your select string. So you are getting the correct response (unless you have row with id "f1" in your table ... ).
Either format/construct your select string with your variable - you can do something like:
Either format/construct your select string with your variable - you can do something like:
select_string = 'select * from bla where id = "{}";'.format(f1)or use (and thats better solution, if its available) a variable substitution provided by a database connection - its usually something like:
cur.execute("select * from bla where id = ?", (f1,))exact syntax might vary according to the database used.