I need to dynamically change tables and variables from time to time, so I wrote a python method like this:
selectQ ="""SELECT * FROM %s WHERE %s = %s;"""
self.db.execute(selectQ,(self.table,self.columnSpecName,idKey,))
return self.db.store_result()
However this results in a syntax error exception. I tried debugging it so I printed the variables in the method and filled them in manually, and that worked. So I am not sure what I am doing wrong ?
Is it because I try to use a substitute for a table ?
Also how do I debug mysqldb so it prints the substituted query as a string ?