Skip to content

Commit a134c80

Browse files
committed
bugfix SQLitePDO
1 parent 3e23e12 commit a134c80

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/DB/SQLitePDO.class.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function queryRow(Query $query)
119119
$res = $this->query($query);
120120
/* @var $res PDOStatement */
121121

122-
$array = $res->fetchAll(PDO::FETCH_COLUMN);
122+
$array = $res->fetchAll(PDO::FETCH_ASSOC);
123123
if (count($array) > 1)
124124
throw new TooManyRowsException(
125125
'query returned too many rows (we need only one)'
@@ -135,9 +135,10 @@ public function queryColumn(Query $query)
135135
$res = $this->query($query);
136136
/* @var $res PDOStatement */
137137

138-
if ($res->rowCount()) {
138+
$resArray = $res->fetchAll(PDO::FETCH_ASSOC);
139+
if ($resArray) {
139140
$array = array();
140-
foreach ($res->fetchAll(PDO::FETCH_COLUMN) as $row) {
141+
foreach ($resArray as $row) {
141142
$array[] = reset($row);
142143
}
143144

0 commit comments

Comments
 (0)