DocnetUK/php-dbal — pull request #23 by kazsaj (2014-09-05 10:36:32+00:00)
Title: Fix for being unable to call fetch (and fetchAll etc.) with arr_params being an empty array

When trying to call ->fetch or ->fetchAll with an empty array (as $arr_params) the following warning is being displayed:
PHP Warning: Wrong parameter count for mysqli_stmt::bind_param() in (...)/docnet/php-dbal/src/Docnet/DB/Statement.php on line 543

This is because an empty array is treated differently that a NULL, this pull request makes it behave exactly the same for both scenarios.

This is all assuming that the actual SQL string doesn't contain any binded variables (SELECT * FROM table).
This was a problem when the SQL statement is created from concatenated strings as the $arr_params was defined as an array but populated only if required.