Commit 3b5a32b6 authored by Kim Hemsø Rasmussen's avatar Kim Hemsø Rasmussen

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

parent 394f7e9a
...@@ -254,9 +254,16 @@ class MysqliStatement implements \IteratorAggregate, Statement ...@@ -254,9 +254,16 @@ class MysqliStatement implements \IteratorAggregate, Statement
$fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle; $fetchStyle = $fetchStyle ?: $this->_defaultFetchStyle;
$a = array(); $a = array();
while (($row = $this->fetch($fetchStyle)) !== null) { if (PDO::FETCH_COLUMN == $fetchStyle) {
$a[] = $row; while (($value = $this->fetchColumn()) !== null) {
$a[] = $value;
}
} else {
while (($row = $this->fetch($fetchStyle)) !== null) {
$a[] = $row;
}
} }
return $a; return $a;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment