Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[mysqli] Added support for fetchAll(PDO::fetch_column) #130

Merged
merged 1 commit into from about 2 years ago

2 participants

Kim Hemsø Rasmussen Benjamin Eberlei
Kim Hemsø Rasmussen

No description provided.

Benjamin Eberlei
Owner

Test?

Kim Hemsø Rasmussen

Already exists. I just made the mysqli driver pass again. you will see the travis tests fail with PR131 until this one get merged aswell.

Benjamin Eberlei beberlei merged commit 493ced5 into from
Benjamin Eberlei beberlei closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 07, 2012
Kim Hemsø Rasmussen [mysqli] Added support for fetchAll(PDO::fetch_column) 3b5a32b
This page is out of date. Refresh to see the latest.
11  lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
@@ -254,9 +254,16 @@ public function fetchAll($fetchStyle = null)
254 254
         $fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle;
255 255
 
256 256
         $a = array();
257  
-        while (($row = $this->fetch($fetchStyle)) !== null) {
258  
-            $a[] = $row;
  257
+        if (PDO::FETCH_COLUMN == $fetchStyle) {
  258
+            while (($value = $this->fetchColumn()) !== null) {
  259
+                $a[] = $value;
  260
+            }
  261
+        } else {
  262
+            while (($row = $this->fetch($fetchStyle)) !== null) {
  263
+                $a[] = $row;
  264
+            }
259 265
         }
  266
+
260 267
         return $a;
261 268
     }
262 269
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.