Commit 10a96cc2 authored by Steve Müller's avatar Steve Müller

only store result in mysqli driver prepared statement if a result is definitely available

parent d00511cd
......@@ -165,14 +165,12 @@ class MysqliStatement implements \IteratorAggregate, Statement
throw new MysqliException($this->_stmt->error, $this->_stmt->errno);
}
// We have a result.
if (false !== $this->_columnNames) {
$this->_stmt->store_result();
}
if (null === $this->_columnNames) {
$meta = $this->_stmt->result_metadata();
if (false !== $meta) {
// We have a result.
$this->_stmt->store_result();
$columnNames = array();
foreach ($meta->fetch_fields() as $col) {
$columnNames[] = $col->name;
......
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