Skip to content

Commit 7a6ec6b

Browse files
authored
Update PDO.class.php
fix select statement new line problem. like " select table1.*, table2.columns from table1 inner join table2 .... ";
1 parent fbf9e8b commit 7a6ec6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PDO.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function iterator($query, $params = null, $fetchMode = PDO::FETCH_ASSOC)
245245
$query = trim($query);
246246
$rawStatement = explode(" ", $query);
247247
$this->Init($query, $params, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
248-
$statement = strtolower($rawStatement[0]);
248+
$statement = strtolower(trim($rawStatement[0]));
249249
if ($statement === 'select' || $statement === 'show' || $statement === 'call' || $statement === 'describe') {
250250
return new PDOIterator($this->sQuery, $fetchMode);
251251
} elseif ($statement === 'insert' || $statement === 'update' || $statement === 'delete') {

0 commit comments

Comments
 (0)