这个没有错误
cursor.execute ("update `1` set `2`='aaa' where `1`='5'")
这个有错误。
cursor.execute ("update `1` set `2`=aaa where `1`='5'")
不同之处在于,我试图将变量“aaa”传递给它。
这是apache的error_log
[2013 年 5 月 14 日星期二 21:20:24] [错误] [客户端 127.0.0.1] OperationalError:(1054,“'字段列表'中的未知列'aaa'”)
在 PHP 中我只需输入$aaa
mysql 查询,因此假设在 python 中我只需输入aaa
.