-- 取數(shù)據(jù)
count = cursor.execute("select * from goods;")
print("查詢到%d條數(shù)據(jù)"% count)
print(cursor.fetchone()) #取一條數(shù)據(jù)
print(cursor.fetchmany()) #取一條
print(cursor.fetchmany(3)) # 傳幾取幾條
print(cursor.fetchall()) #取所有
print(cursor.fetchall())#取所有

取兩次所有的結(jié)果
line_content = cursor.fetchone()
print(line_content)(顯示元組())
-- 索引
print(line_content[0])
print(line_content[1])
print(line_content[2])

-- 循環(huán)line_content:
for temp in line_content:
print(temp)
--??fetchmany循環(huán)
lines = cursor.fetchmany(5)
for temp in lines:
print(temp)
# 關(guān)閉Cursor對象
cursor.close() #關(guān)閉游標(biāo)
conn.close()
print(cursor.fetchone(),'-------------->')?
count = cursor.execute("select * from goods;")
