gpt4 book ai didi

mysql - python3 mysqldb 游标.fetchone

转载 作者:行者123 更新时间:2023-11-29 10:44:38 26 4
gpt4 key购买 nike

我正在尝试查找cursor.fetchone的完整文档,我能找到的只是: http://mysql-python.sourceforge.net/MySQLdb-1.2.2/public/MySQLdb.cursors.CursorStoreResultMixIn-class.html#fetchone

我的问题是:到底返回了什么?一个普通的Python数组?如果没有更多行,它会返回什么?如果连接断开,它会做什么?抛出错误?有独特的返回值吗?我不知道为什么我找不到这方面的真正文档。预先感谢您

最佳答案

我会尽力按顺序回答您的问题。

What is exactly returned?

元组或字典,具体取决于您如何进行连接。

What does it return if there no more rows?

What does it do if the connection is dropped?

引发异常。例如,如果是由于超时,则会出现 MySQLdb.OperationalError

I am not sure why I can't find real documentation on this

在这里试试:https://mysqlclient.readthedocs.io/

关于mysql - python3 mysqldb 游标.fetchone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44854143/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com