When I execute a MySQLi query with my custom function I get this error...
Fatal error: Call to a member function execute() on a non-object in /Applications/MAMP/htdocs/RevFramework/Application/Model/Engine/eMySQLi.php on line 92
I really don't know what's wrong... That is if I set $types and $params to null, else I'm sure call_user_func_array
would also throw an error.
public function query($SQL, $types = null, $params = null)
{
$this->result = $this->db->prepare($SQL);
if(isset($types) && isset($params))
{
$bind_names[] = $types;
for ($i = 0; $i < count($params); $i++)
{
$bind_name = 'bind' . $i;
$$bind_name = $params[$i];
$bind_names[] = &$$bind_name;
}
call_user_func_array(array($this->result, 'bind_param'), $bind_names);
}
$this->result->execute();
}
The query it is doing:
$class->query("SELECT name FROM rev_widgets ORDER BY order");
I have absolutely no idea what could be wrong.
Any help is appreciated!