Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@kimhemsoe
Collaborator

No description provided.

@beberlei
Owner

Test?

@kimhemsoe
Collaborator

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.

@beberlei beberlei merged commit 493ced5 into doctrine:master
@kimhemsoe kimhemsoe deleted the kimhemsoe:mysqli_fetchall_cloumn branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
View
11 lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
@@ -254,9 +254,16 @@ public function fetchAll($fetchStyle = null)
$fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle;
$a = array();
- while (($row = $this->fetch($fetchStyle)) !== null) {
- $a[] = $row;
+ if (PDO::FETCH_COLUMN == $fetchStyle) {
+ while (($value = $this->fetchColumn()) !== null) {
+ $a[] = $value;
+ }
+ } else {
+ while (($row = $this->fetch($fetchStyle)) !== null) {
+ $a[] = $row;
+ }
}
+
return $a;
}
Something went wrong with that request. Please try again.