As far as I've done my searchings over Google and everything, it looks like this is a pretty common issue, but I cannot seem to fix it. Plus, I think that I have a little different usage of the function as others out there. And, after about 3 hours of no luck, I'm posting here!
function free_result(){ # LINE 48
$free = "SELECT SHOW DESCRIBE EXPLAIN"; # LINE 49
$free = explode(" ", $free); # LINE 50
$sql = $this->sql; # LINE 51
while(list($key, $value) = each($free)){ # LINE 52
if(preg_match("/\b".$value."\b/", $sql)){ # LINE 53
$result = $this->result; # LINE 54
if(!mysqli_free_result($result)){ # LINE 55
$this->errors("Invalid result: <b>{$result}</b>. Couldn't free result."); # LINE 56
} # LINE 57
} # LINE 58
} # LINE 59
} # LINE 60
# LINE 61
function query($sql){ # LINE 62
$this->query_id = mysqli_query($this->connection, $sql); # LINE 63
$this->result = mysqli_store_result($this->connection); # LINE 64
$this->sql = $sql; # LINE 65
if(!$this->query_id){ # LINE 66
$this->errors("Couldn't query: <b>{$sql}</b>"); # LINE 67
return 0; # LINE 68
} # LINE 69
$this->affected = mysqli_affected_rows($this->connection); # LINE 70
# LINE 71
return $this->query_id; # LINE 72
} # LINE 73
These are 2 of the functions which are within my database class. But I think only these 2 are needed for resolving the issue.
So, the error I'm recieving is:
"Warning: mysqli_free_result() expects parameter 1 to be mysqli_result,
boolean given in [file path]\database.class.php on line 55"
#followed by my database class error handling
"Invalid result: . Couldn't free result."
As far as my understanding about this goes, I think that the problem is with $result variable (LINE 54, LINE 64), but because this is my first adventure with MySQLi then I'm not quite sure.
I hope you understand the issue and will be able to help! Thanks in advance!