python脚本中的这个语句给我一个错误
def Create(file0):
try:
connection = db.connect(host = 'localhost', user = '...', password = '', database ='...')
cursor = connection.cursor(db.cursors.DictCursor)
cursor.execute("CREATE TABLE %s (filename varchar(255) not null); ", (file0))
except db.Error as e :
result = "DB is in trouble at the moment. Call again later."
print ( e )
(1064,你“你的SQL语法有错误;请查看手册 对应于您的MySQL服务器版本,以便使用正确的语法 在''tablename'附近(文件名varchar(255)not null)'在第1行“)
print(file 0 )
提供没有任何''
但是当它转到“create statement”时,它会给出额外的引号'tablename'。
如何解决这个问题?