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]); }
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步