PHP PDO multiple select query consistently dropping last rowset

前端 未结 2 963
臣服心动
臣服心动 2021-01-05 13:46

I\'m experiencing what appears to be a bug using a PDO statement to make multiple selects.

I\'m building a SQL query that has many SELECTs, and regardless of how ma

2条回答
  •  爱一瞬间的悲伤
    2021-01-05 14:31

    To avoid that PDOException just use columnCount:

    while ($statment->columnCount()) {
         $rowset = $statment->fetchAll(PDO::FETCH_ASSOC);
         $statment->nextRowset();
    }
    

提交回复
热议问题