Code where the error appears:
def isID_inTable(id,table='question'):
cursor.execute('SELECT id FROM %s;' , [table])
Error message:
psycopg2.errors.SyntaxError: syntax error at or near "'question'"
LINE 1: SELECT id FROM 'question';
Code where the error appears:
def isID_inTable(id,table='question'):
cursor.execute('SELECT id FROM %s;' , [table])
Error message:
psycopg2.errors.SyntaxError: syntax error at or near "'question'"
LINE 1: SELECT id FROM 'question';
You need a where clause for the query to execute
SELECT id FROM table WHERE condition