Unknown column ‘’ in ‘field list’ 解决办法
正确写法:
cursor.execute("update book set name='%s' where id=%d" % (name, int(id)))
错误写法:
cursor.execute("update book set name=%s where id=%d" % (name, int(id)))
你要获取字符串接收方式是
'%s'
要获取整形数字
int(id)
其他原因
多了一个空格
https://blog.csdn.net/gnail_oug/article/details/53606608