Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot update #15

Closed
hugo021 opened this issue Sep 9, 2015 · 6 comments
Closed

cannot update #15

hugo021 opened this issue Sep 9, 2015 · 6 comments

Comments

@hugo021
Copy link

hugo021 commented Sep 9, 2015

sql2='update watch_monitor_profile set data='test' where id=43127'
yield cur1.execute(sql2)

but it not work,and nothing happend

@methane
Copy link
Member

methane commented Sep 14, 2015

I can't reproduce what you said.
Please provide simple standalone script to reproducible.

@methane
Copy link
Member

methane commented Nov 10, 2015

No response for long time.

@methane methane closed this as completed Nov 10, 2015
@scoopseven
Copy link

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
Copy link
Member

methane commented Feb 26, 2016

@scoopseven You didn't commit, do you?

@scoopseven
Copy link

I don't see commit anywhere in the docs or codebase. cur.commit()?

@methane
Copy link
Member

methane commented Feb 26, 2016

yield conn.commit()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants