>>> _cursor.execute("select * from bitter.test where id > 34") 1L >>> _cursor.fetchall() ({'priority': 1L, 'default': 0, 'id': 35L, 'name': 'chinanet'},) >>> _cursor.execute("select * from bitter.test where id > 34") 1L >>> _cursor.fetchall() ({'priority': 1L, 'default': 0, 'id': 35L, 'name': 'chinanet'},) >>>
第一次,我運行cursor.execute和cursor.fetchall,我得到了正確的結果。所述第二時間我運行執行和使用fetchall之前遊標從mysql取錯記錄
我插入數據到MySQL其中的ID 36,我也運行在MySQL
但commit命令cursor.execute /使用fetchall counld只能得到前的數據沒有新數據
你是怎麼做到的二次插入?從Python還是MySQL shell? – 2012-03-19 04:31:57
來自MySQL shell – stutiredboy 2012-03-19 04:59:29