execute

Python MySQLdb type error while using execute with %s

Python MySQLdb type error while using execute with %s Question: I’ve started with a simple mysql query in python, returning all the columns of the table. For some reason this command works: cursor.execute(“SHOW columns from students”) While all of the following return a type error: cursor.execute(“SHOW columns from %s”, ‘students’) cursor.execute(“SHOW columns from %s”, (‘students’,)) …

Total answers: 2