IM處理strage問題,這是這樣的:蟒蛇MySQL的選擇只返回第一行的表,並不是所有
此查詢應該返回我的所有表:
db = MySQLdb.connect(host="localhost", port=3306, user="A", passwd="B", db="X")
cursor = db.cursor()
cursor.execute("select * from mytable")
cursor.fetchall()
for row in cursor:
print row
for循環應該打印光標中的所有行,但它只會打印第一個。 它看起來光標只填滿了第一行。
有什麼我錯過了嗎? 謝謝
沒有區別,我仍然得到第一行:( – user1229351