yajra / pdo-via-oci8

PHP PDO_OCI functions via OCI8 extension
Other
88 stars 61 forks source link

Fix fetch mode usage. #59

Closed silvioq closed 6 years ago

silvioq commented 6 years ago

Use PDO::FETCH_BOTH as default. PDO::ATTR_DEFAULT_FETCH_MODE is an invalid fetch mode.

This commit fixes $stmt->fetch(); without fetch style, that returns false (at least in php 7.1). PDO::ATTR_DEFAULT_FETCH_MODE is invalid for fetch. (see http://php.net/manual/en/pdostatement.fetch.php)

Now, fetch without fetch style uses default fetch for connection or PDO::FETCH_BOTH if it is not defined.

yajra commented 6 years ago

Looks good and doesn't seem to break my app. Thanks!

silvioq commented 6 years ago

Thanks!