cannot update
hugo021 opened this issue · 6 comments
hugo021 commented
sql2='update watch_monitor_profile set data='test' where id=43127'
yield cur1.execute(sql2)
but it not work,and nothing happend
methane commented
I can't reproduce what you said.
Please provide simple standalone script to reproducible.
methane commented
No response for long time.
scoopseven commented
I'm having this same problem.
conn = yield tornado_mysql.connect(host='host', port=3306, user='root', passwd='', db='dbname')
cur = conn.cursor()
yield cur.execute("select id, ad_id, someother_id, another_id, onemore_id from links where id = %s" %idd )
found = cur.fetchone()
if found:
print 'yes found'
yield cur.execute("update imp set imp_count = imp_count + 1 where id = %s" %idd)
Thoughts?
methane commented
@scoopseven You didn't commit, do you?
scoopseven commented
I don't see commit anywhere in the docs or codebase. cur.commit()?
methane commented
yield conn.commit()