gpt4 book ai didi

MySQL - 具有多个结果集的存储过程

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

我在一个存储过程中使用了两个 select 语句,但它只返回一个 select 语句表,如何获取两个表的记录集请给我建议?

最佳答案

确保您使用的是 mysqli php 中的扩展,以便能够从存储过程中获取多个结果资源——标准的 PHP mysql 接口(interface)不支持它。

从现在的离线介绍来看,这似乎是对类(class)的一个很好的介绍,尤其是:

First thing’s first, you shouldn’t treat calls to stored procedures which return a resultset as you would normal SQL queries. The reason being is that when executed, a stored procedure will give you two resultsets back. One with the actual resultset and another which sends the status of the stored procedure (OK/ERR).

关于MySQL - 具有多个结果集的存储过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3394947/

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