EllisLab/CodeIgniter — Issue #725: call_user_func_array() error with $this->db->call_function()
Author: davbea
Created: 2011-11-30 13:10:27+00:00
State: open

PHP Version 5.3.6-13ubuntu3.2 - mysql 5.1.58 - CI 2.1

hello,

As indicate in this post http://codeigniter.com/forums/viewthread/146600/

function call_function()
example : echo $this->db->call_function('get_client_info');

generate this bug :

A PHP Error was encountered
Severity: Warning
Message: call_user_func_array() expects parameter 2 to be array, null given
Filename: database/DB_driver.php
Line Number: 1019

If you replace this :
return call_user_func_array($function, $args);
by
if($args == null) {
return call_user_func($function);
} else {
return call_user_func_array($function, $args);
}

There is no more bug.

echo $this->db->call_function('get_client_info')

mysql_get_client_info doesn't use any argument

Thanks to correct it.

David