fix: bad cursor state
This commit is contained in:
@@ -32,15 +32,19 @@ class Connection
|
|||||||
throw new SqlException('SQL There was an error executing the request');
|
throw new SqlException('SQL There was an error executing the request');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strpos($sql, "SELECT") !== false) {
|
||||||
$rows = $statement->fetchAll($fetchMode);
|
$rows = $statement->fetchAll($fetchMode);
|
||||||
|
|
||||||
if (!is_array($rows)) {
|
if (!is_array($rows)) {
|
||||||
throw new SqlException('PDO Unable to retrieve the result');
|
throw new SqlException('PDO Unable to retrieve the result');
|
||||||
}
|
}
|
||||||
|
|
||||||
return new OdbcResultSet($rows);
|
return new OdbcResultSet($rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$statement->closeCursor();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replaces de old execute($sql, $throwErrors=false)
|
* Replaces de old execute($sql, $throwErrors=false)
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user