从过程Phalconphp获取输出参数

时间:2018-05-19 08:48:06

标签: phalcon

我的代码:

$item = new Items2;
        $connection = $item->getReadConnection();
        $sql = "CALL `OLViewItemsListViewAllWithCount`('','','',0,0,0,0,0,0,0,'2018-05-15',0,0,10,@aa);";
        $items = new Resultset(null,$robot,$connection->query($sql));

我需要从此Result中获取@aa作为输出参数

我怎么能得到它?

需要在第二个查询中选择参数,如..

$item = new Items2;
        $connection = $item->getReadConnection();
        $sql = "CALL `OLViewItemsListViewAllWithCount`('','','',0,0,0,0,0,0,0,'2018-05-15',0,0,10,@aa);";
        $items = $robot,$connection->query($sql)->fetchAll(\Phalcon\Db::FETCH_ASSOC);;
$sql2 = "SELECT @aa"; 

$aa = $connection->query($sql2)->fetch();

echo $aa['@aa];

0 个答案:

没有答案