Discuss / Python / cursor.execute('select * from user where id =%s',('1',))

cursor.execute('select * from user where id =%s',('1',))

Topic source

请问,为什么要写成('1',),而不是'1'呢?

廖雪峰

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

execute()的第二个参数是tuple


  • 1

Reply