Skip to content

Commit

Permalink
Update PDO.class.php
Browse files Browse the repository at this point in the history
Added in Stored procedure 'Call' to statement OR condition.
  • Loading branch information
narratones authored May 14, 2019
1 parent bad17b1 commit 20670f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PDO.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function query($query, $params = null, $fetchMode = PDO::FETCH_ASSOC)
$rawStatement = explode(" ", $query);
$this->Init($query, $params);
$statement = strtolower($rawStatement[0]);
if ($statement === 'select' || $statement === 'show') {
if ($statement === 'select' || $statement === 'show' || $statement === "call") {
return $this->sQuery->fetchAll($fetchMode);
} elseif ($statement === 'insert' || $statement === 'update' || $statement === 'delete') {
return $this->sQuery->rowCount();
Expand All @@ -245,7 +245,7 @@ public function iterator($query, $params = null, $fetchMode = PDO::FETCH_ASSOC)
$rawStatement = explode(" ", $query);
$this->Init($query, $params, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
$statement = strtolower($rawStatement[0]);
if ($statement === 'select' || $statement === 'show') {
if ($statement === 'select' || $statement === 'show' || $statement === "call") {
return new PDOIterator($this->sQuery, $fetchMode);
} elseif ($statement === 'insert' || $statement === 'update' || $statement === 'delete') {
return $this->sQuery->rowCount();
Expand Down

0 comments on commit 20670f9

Please sign in to comment.