PHP-PDO-Get使用multi-execute时的行计数

PHP-PDO-Get使用multi-execute时的行计数,php,mysql,pdo,Php,Mysql,Pdo,============== $query = $this->connection[db::$before_sent['conn']]->prepare(db::$before_sent['sttm']); for ($x=0; $x<db::$before_sent['excount']; $x++) { $query->execute(db::$before_sent['exval'][$x]); db::$af

==============

$query = $this->connection[db::$before_sent['conn']]->prepare(db::$before_sent['sttm']);
        for ($x=0; $x<db::$before_sent['excount']; $x++) {
          $query->execute(db::$before_sent['exval'][$x]);
          db::$after_sent[db::$formname]['rowCount'][] = $query->rowCount();
          $query->nextRowset($x+1);
        }
$query=$this->connection[db::$before\u sent['conn']]->prepare(db:$before\u sent['sttm']);
对于($x=0;$xexecute(db::$before_sent['exval'][$x]);
db::$after_sent[db::$formname]['rowCount'][]=$query->rowCount();
$query->nextRowset($x+1);
}
在这段代码中,您可以看到我使用了rowCount()和nextRowset() 我知道,当我使用多个语句时,这是有效的 但是,我是否还有其他方法可以这样做(一条语句和多条执行语句) 正如您所看到的代码[它现在返回一个错误的行数]


谢谢!

为什么不将所需内容包装到存储过程中,让它根据您的操作返回信息(out参数)或结果集中?谢谢您的回复,但实际上我知道如何通过其他方式获取行数,但我真的想知道是否可以使用nextRowset()使用多个executerowCount是不可靠的。为什么不将所需内容包装到存储过程中,让它根据您的操作返回信息(out参数)或结果集中呢?谢谢您的回复,但实际上我知道如何用其他方法获取行数,但我真的想知道我是否可以将nextRowset()用于多个executerowCount是不可靠的。