我正在插入(日期和时间);int)使用查询的表中的值:mycursor.execute("insert into adb (date, lecture) values (%s,%s)", f_date, coun)
未插入值(&A);打印输出为插入的-1条记录
coun=0
mycursor = mydb.cursor()
mycursor.execute("Select count(*) from adb")
myresult = mycursor.fetchone()
for a in myresult:
coun = int(a)
coun=coun+1
now = datetime.datetime.now()
f_date = now.strftime('%Y-%m-%d')
mycursor.execute("insert into adb (date, lecture) values (%s,%s)", f_date, coun)
mydb.commit()
print(mycursor.rowcount, "record inserted.")
目前没有回答
相关问题 更多 >
编程相关推荐