【发布时间】:2012-04-03 15:08:39
【问题描述】:
>>> _cursor.execute("select * from bitcoin.test where id > 34")
1L
>>> _cursor.fetchall()
({'priority': 1L, 'default': 0, 'id': 35L, 'name': 'chinanet'},)
>>> _cursor.execute("select * from bitcoin.test where id > 34")
1L
>>> _cursor.fetchall()
({'priority': 1L, 'default': 0, 'id': 35L, 'name': 'chinanet'},)
>>>
第一次,我运行 cursor.execute 和 cursor.fetchall,我得到了正确的结果。
在我第二次运行执行和 fetchall 之前
我将数据插入 id 为 36 的 mysql,我也在 mysql 中运行 commit 命令
但是 cursor.execute/fetchall 只能获取之前没有新数据的数据
【问题讨论】:
-
第二次插入是怎么做的?来自 Python 还是 MySQL shell?
标签: python mysql-python