I want to check whether the table exists or not before inserting the data. This is what i have tried:
def checkTables(tablename):
    stmt = "SHOW TABLES LIKE %s"%tablename          
    cursor.execute(stmt)
    result = cursor.fetchone()          
    return result
But it gives me error saying:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ctg_payload3' at line 1
 
     
     
     
    