php mysql procedure实现获取多个结果集的方法【基于thinkPHP】
作者:ifeixiang 时间:2023-11-19 08:27:32
本文实例讲述了php mysql procedure实现获取多个结果集的方法。分享给大家供大家参考,具体如下:
protected function getRs($id) {
$db = new mysqli(C("DB_HOST"), C("DB_USER"), C("DB_PWD"), C("DB_NAME"), C("DB_PORT"));
if (mysqli_connect_errno())
throw_exception(mysqli_connect_error());
$sql = "call `room_match`.`wsKocMatchLoadResultHeader`($id);";
$results = array();
if ($db->multi_query($sql)) {
do {
$records = array();
if ($result = $db->use_result()) {
while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
$records[] = $row;
}
$result->close();
}
$results[] = $records;
} while ($db->next_result());
}
$db->close();
$this->assign("list1", $results[1]);
$this->assign("list2", $results[2]);
$this->assign("list3", $results[3]);
}
希望本文所述对大家PHP程序设计有所帮助。
标签:php,mysql,结果集
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
理解JavaScript变量作用域更轻松
2024-04-16 09:25:07
一文弄懂Pytorch的DataLoader, DataSet, Sampler之间的关系
2022-06-27 14:21:53
![](https://img.aspxhome.com/file/2023/2/121062_0s.png)
Python函数用法和底层原理分析
2023-09-13 23:42:37
![](https://img.aspxhome.com/file/2023/6/107286_0s.png)
Python3 ffmpeg视频转换工具使用方法解析
2021-07-28 15:00:30
![](https://img.aspxhome.com/file/2023/8/99038_0s.png)
基于.NET平台常用的框架和开源程序整理
2024-06-05 09:26:51
pytorch加载自己的图像数据集实例
2021-09-25 12:00:49
![](https://img.aspxhome.com/file/2023/4/131394_0s.jpg)
python实现学生信息管理系统
2021-11-27 11:46:42
什么样的分页案例才是好的
2007-11-23 19:08:00
![](https://img.aspxhome.com/file/UploadPic/up/2007112319363210.jpg)
element弹窗表格的字体模糊bug解决
2024-04-18 10:53:25
![](https://img.aspxhome.com/file/2023/1/136411_0s.jpg)
Go语言实战之实现一个简单分布式系统
2024-05-05 09:33:56
![](https://img.aspxhome.com/file/2023/1/127461_0s.png)
Python基于递归算法求最小公倍数和最大公约数示例
2021-07-20 09:36:23
写SQL语句的经验
2009-04-13 16:02:00
Python 解决logging功能使用过程中遇到的一个问题
2023-05-25 11:31:05
利用numpy+matplotlib绘图的基本操作教程
2021-01-26 11:14:31
![](https://img.aspxhome.com/file/2023/8/133778_0s.png)
vue实现动态路由详细
2024-05-05 09:25:19
Python实现聚类K-means算法详解
2023-04-22 07:48:36
![](https://img.aspxhome.com/file/2023/2/105812_0s.png)
Keras设定GPU使用内存大小方式(Tensorflow backend)
2021-12-20 22:15:12
python中的annotate函数使用
2021-04-10 01:52:59
![](https://img.aspxhome.com/file/2023/1/107071_0s.png)
原生js实现下拉菜单
2024-04-28 09:43:04
![](https://img.aspxhome.com/file/2023/5/132815_0s.png)
Python中输入和输出(打印)数据实例方法
2021-03-25 22:32:11
![](https://img.aspxhome.com/file/2023/7/127617_0s.png)