【发布时间】:2020-09-08 09:54:22
【问题描述】:
我正在尝试在同一页面中调用两个 sql 存储过程 我试过的是
mysqli_query($con,"DROP PROCEDURE IF EXISTS count_nodes_all_1 ");
mysqli_query($con,"CREATE PROCEDURE count_nodes_all_1()
BEGIN
CALL count_nodes_left_1('id-1',750);
CALL count_nodes_right_1('id-2',750);
END");
$qry = "CALL count_nodes_all_1";
if ($result = mysqli_query($con, $qry))
{
while ($row = mysqli_fetch_array($result))
{
$total_left_1 = $row['total_left_1'];
$total_right_1 = $row['total_right_1'];
?>
<th scope="row"><?php echo number_format($total_left_1); ?></th>
<th scope="row"><?php echo number_format($total_right_1); ?></th>
这里$total_left_1 = $row['total_left_1']; 是第一个过程的输出,$total_right_1 = $row['total_right_1']; 是第二个过程的输出
现在,问题是我得到了<?php echo number_format($total_left_1); ?> 的输出并且无法得到<?php echo number_format($total_right_1); ?> 的输出它只是显示Notice: Undefined index: total_right_1 in G:\XampNew\htdocs
请在这方面帮助我
【问题讨论】:
标签: php mysql stored-procedures