Skip to content

Commit

Permalink
fix php 7.4 incompatible resultset fetch on empty counts
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel André Eikeland committed Feb 17, 2020
1 parent a2502ef commit 836cfaa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Resultset.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ public function __construct(Statement $statement)
$this->int_ptr = 0;
} elseif ($this->query->isCount()) {
$value = $statement->fetch();
$this->max_ptr = $value['num_col'];
if ($value === false ) {
$this->max_ptr = 0;
} else {
$this->max_ptr = $value['num_col'];
}
}
}
} catch (\Exception $e) {
Expand Down

0 comments on commit 836cfaa

Please sign in to comment.