Discuss / Python / mysql占位符 赋值

mysql占位符 赋值

脑袋有炮

#1 Created at ... [Delete] [Delete and Lock User]

老师,我按照您的例子中这句: cursor.execute('select from teacher where id = %s','3')执行后报了一个SQL的错误,改成: cursor.execute('select from teacher where id = %s',['3',]) 就正常了 这个是 mysql还是python2.7的原因?


  • 1

Reply