【发布时间】:2017-08-16 10:44:33
【问题描述】:
大家好,请告诉我这个参数在 PDO fetchAll 函数中是什么意思 fetchAll(PDO::FETCH_OBJ); 我在手册中查过,但我什么也没找到,我是从教程中得到的,但我不知道它是什么意思
【问题讨论】:
-
你能发个代码吗?
-
if ($this->_query->execute()) { $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);
-
表示结果数组中的每一行都是一个对象,就像调用
$stmt->fetchObject()一样。 -
我在手册里查过不,你没有在手册里查过php.net/manual/en/pdostatement.fetch.php
-
不,你没有
fetch_style Controls the contents of the returned array as documented in PDOStatement::fetch()