【发布时间】:2011-11-20 17:32:58
【问题描述】:
我在我的项目中使用 pymysql,并且需要 use_result 来获取行? pymysql 中有一个 fetchmany 函数。和 use_result 一样吗?
【问题讨论】:
我在我的项目中使用 pymysql,并且需要 use_result 来获取行? pymysql 中有一个 fetchmany 函数。和 use_result 一样吗?
【问题讨论】:
mysql_use_result() + mysql_fetch_row() 在 mysql 中用于一次获取 1 行数据并存储在客户端。
在 pymysql 中,您可以为此目的使用 fetchone() 函数。您还可以使用 fetchmany() 来获取行的子集,并使用 fetchall() 来存储整个结果客户端 - 就像 mysql_store_result()。
您可以阅读this 了解每个示例。
【讨论】: