1. 程式人生 > >python 操作mysql數據中fetchone()和fetchall()

python 操作mysql數據中fetchone()和fetchall()

python AI 就是 ews 結果 mil 多個 null font

fetchone() :

返回單個的元組,也就是一條記錄(row),如果沒有結果 則返回 None

fetchall() :

返回多個元組,即返回多個記錄(rows),如果沒有結果 則返回 ()

需要註明:在MySQL中是NULL,而在Python中則是None

python 操作mysql數據中fetchone()和fetchall()