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)+'")') //变量上也要加上双引号否则会报错

 

你可能感兴趣的:(Python with MYSQL - sytax problem)