File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ public function queryRow(Query $query)
119
119
$ res = $ this ->query ($ query );
120
120
/* @var $res PDOStatement */
121
121
122
- $ array = $ res ->fetchAll (PDO ::FETCH_COLUMN );
122
+ $ array = $ res ->fetchAll (PDO ::FETCH_ASSOC );
123
123
if (count ($ array ) > 1 )
124
124
throw new TooManyRowsException (
125
125
'query returned too many rows (we need only one) '
@@ -135,9 +135,10 @@ public function queryColumn(Query $query)
135
135
$ res = $ this ->query ($ query );
136
136
/* @var $res PDOStatement */
137
137
138
- if ($ res ->rowCount ()) {
138
+ $ resArray = $ res ->fetchAll (PDO ::FETCH_ASSOC );
139
+ if ($ resArray ) {
139
140
$ array = array ();
140
- foreach ($ res -> fetchAll ( PDO :: FETCH_COLUMN ) as $ row ) {
141
+ foreach ($ resArray as $ row ) {
141
142
$ array [] = reset ($ row );
142
143
}
143
144
You can’t perform that action at this time.
0 commit comments