EllisLab/CodeIgniter — Issue #1154: mysqli_free_result() Error
Author: vmichnowicz
Created: 2012-03-10 02:30:44+00:00
State: open

I'm getting an error with ExpressionEngine 2.4 (However, it *seems* to be more of a CodeIgniter-related issue).

````
A PHP Error was encountered
Severity: Warning
Message: mysqli_free_result() [function.mysqli-free-result]: Couldn't fetch mysqli_result
Filename: mysqli/mysqli_result.php
Line Number: 113
````

Changing the `free_result` method to the following seems to resolve the error.

````
function free_result()
{
if ( is_object($this->result_id) && $this->result_id instanceof mysqli_result && is_resource($this->result_id) )
{
mysqli_free_result($this->result_id);
$this->result_id = FALSE;
}
}
````

I'm not sure if this error is just a case of some bad EE code, but I figured I would point it out in case anyone else is running into a similar issue.