0
我使用MySQLdb的插入行:Python的MySQLdb的回報插入行,但MySQL的返回emptyset
def insertNewLog(self,uid,beginDate,endDate,logs):
qry1 = """INSERT INTO logs (owner,createDate,endDate,log) VALUES (%s,%s,%s,%s); """
cursor = self.db.cursor()
beginDate = int(time.mktime(beginDate.timetuple()))
endDate = int(time.mktime(endDate.timetuple()))
print beginDate
print endDate
cursor.execute(qry1,(uid,beginDate,endDate,logs),)
print "inserted normally"
print "Number of rows inserted: %d" % cursor.rowcount
我得到這樣的輸出:
1337720045
1337740625
inserted normally
Number of rows inserted: 1
但是當我做了選擇上我的數據庫MySQL的殼我得到'空集'。我檢查我的mysql日誌,那裏沒有任何報告。我有點困惑。