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

Kim Hemsø Rasmussen Benjamin Eberlei
Kim Hemsø Rasmussen
Collaborator

No description provided.

Benjamin Eberlei
Owner

Test?

Kim Hemsø Rasmussen
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.

Benjamin Eberlei beberlei merged commit 493ced5 into from
Kim Hemsø Rasmussen kimhemsoe deleted the 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
11 lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
View
@@ -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.