"청구 계정"테이블에 일부 데이터를 삽입하려고하는데 아래 방법으로 시도했습니다. 데이터가 테이블에 삽입되지 않더라도 오류는 없었습니다. 내가 여기서 뭐 잘못하고 있니? 이 작업을 위해 파이썬의 mysql.connector 모듈을 사용하고 있습니다.
def billingaccounts(self,stag,prod):
print "Updating the consilidated daily bills for stag and prod"
cursor = self.testdb.cursor()
stag = 87
prod = 45
now = '2016-06-03'
to = 84
cursor.execute('INSERT INTO iaas.billing_accounts (date, staging_account, production_acount, total) VALUES (%s, %s, %s, %s)',(now,stag,prod,to))
변경 사항을 보려면 서버에 커밋을 보내야합니다.
https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-commit.html
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다