
public function queryAllRows($sql, $parmas = array())
{
$result = $this->query($sql, $parmas);
$rows = array();
$rowcount = 0;
if ($result) {
do {
$result->setFetchMode(PDO::FETCH_ASSOC);
foreach ($result as $row) {
if (isset($row[$this->primary])) {
if (!is_string($this->access)) {
$this->access[$this->primary] = true;
}
}
$rows[$rowcount][] = $row; //修正了这句增加了[]
}
$rowcount++;
} while ($result->nextRowset());
}
return $rows;
}
0 个回复