【发布时间】:2017-02-10 11:52:34
【问题描述】:
我创建了一个过程,其中我有两个 select 语句正在运行。
$stmt = $this->_connection->execute("CALL myFunction(:user_id)", [
'user_id' => $userId
]);
但是当我试图像这样调用 nextRowset() 时
$stmt->nextRowset();
它给了我错误
调用未定义的方法 Cake\Database\Log\LoggingStatement::nextRowset()
所以,我的问题是如何在 Cakephp 3 中调用 nextRowset()
【问题讨论】:
-
您确定
$stmt是pdoStmt 吗? -
@u_mulder 不,不是,正如您从错误中看到的那样。我不知道 cakephp 3 中获取 pdostmt 的方法。
-
除非你有自己的 StatementInterface 实现,否则你不能。基本上你需要扩展 cake 的 PDOStatement 才能访问原始的 \PDOStatement。
-
@AlexBlex 那么没有直接的方法吗?我应该编辑 cakephp 的核心文件吗?
-
不,没有直接的方法。更改框架的文件是最不推荐的方式。尝试扩展核心类并让框架使用它们。
标签: php mysql cakephp pdo cakephp-3.0