Skip to content

Commit

Permalink
Update PDO.class.php
Browse files Browse the repository at this point in the history
fix select statement  new line  problem.
like 
"
select 
table1.*, table2.columns
from table1 inner join table2
....
";
  • Loading branch information
merong authored Mar 30, 2020
1 parent fbf9e8b commit 7a6ec6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PDO.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function iterator($query, $params = null, $fetchMode = PDO::FETCH_ASSOC)
$query = trim($query);
$rawStatement = explode(" ", $query);
$this->Init($query, $params, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
$statement = strtolower($rawStatement[0]);
$statement = strtolower(trim($rawStatement[0]));
if ($statement === 'select' || $statement === 'show' || $statement === 'call' || $statement === 'describe') {
return new PDOIterator($this->sQuery, $fetchMode);
} elseif ($statement === 'insert' || $statement === 'update' || $statement === 'delete') {
Expand Down

0 comments on commit 7a6ec6b

Please sign in to comment.