mirror of
https://github.com/dg/dibi.git
synced 2025-02-22 18:02:25 +01:00
SqlsrvResult: fixed illegal false return value from sqlsrv_fetch_array() (#344)
On error, sqlsrv_fetch_array() returns false, which causes an error due to the return type declaration. This commit handles that by casting such value to null the same way other result drivers do it.
This commit is contained in:
parent
f2927a1b08
commit
c7dee4d822
@ -61,7 +61,7 @@ class SqlsrvResult implements Dibi\ResultDriver
|
||||
*/
|
||||
public function fetch(bool $assoc): ?array
|
||||
{
|
||||
return sqlsrv_fetch_array($this->resultSet, $assoc ? SQLSRV_FETCH_ASSOC : SQLSRV_FETCH_NUMERIC);
|
||||
return Dibi\Helpers::false2Null(sqlsrv_fetch_array($this->resultSet, $assoc ? SQLSRV_FETCH_ASSOC : SQLSRV_FETCH_NUMERIC));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user