MySQL PDO Query不显示过程输出变量

时间:2018-04-30 21:45:55

标签: mysql stored-procedures

我想在PDO设置中使用过程获取out变量。我得到一个空数组();

      $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();

0 个答案:

没有答案