首页 > 解决方案 > MySQL PDO 查询未显示过程输出变量

问题描述

我想在我的 PDO 设置中获得一个带有过程的变量。我得到一个空数组();

      $connection->query('
       drop procedure if exists relatives;
       create procedure relatives(in parent int(11),out counted int(11))
       begin
        set @counted=1;
       end;
      ');
      $fetch=$connection->query('call relatives(1,@counted); select @counted as c;')->fetchall();

标签: mysqlstored-procedures

解决方案


推荐阅读