Python with MYSQL - sytax problem

Con= MySQLdb.connect(host='192.168.4.166',user='root',passwd='1234',db='test')
cur=Con.cursor()
cur.execute('insert into staff_daily(Date,Name,Task_num) values(curdate(),"nicole","'+str(nicole)+'")') //变量上也要加上双引号否则会报错

 

posted @ 2016-01-25 15:33  西番莲果汁  阅读(276)  评论(0编辑  收藏  举报