PMC-1002 Error message: "mysql_free_result() couldnt fetch mysql_result" in appears in the _ERROR_ variable
This commit is contained in:
@@ -171,10 +171,12 @@ class MSSQLResultSet extends ResultSetCommon implements ResultSet
|
|||||||
/**
|
/**
|
||||||
* @see ResultSet::close()
|
* @see ResultSet::close()
|
||||||
*/
|
*/
|
||||||
function close()
|
public function close()
|
||||||
{
|
{
|
||||||
if (extension_loaded('sqlsrv')) {
|
if (extension_loaded('sqlsrv')) {
|
||||||
$ret = @sqlsrv_free_stmt($this->result);
|
if (is_resource($this->result)) {
|
||||||
|
$ret = @sqlsrv_free_stmt($this->result);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$ret = @mssql_free_result($this->result);
|
$ret = @mssql_free_result($this->result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,12 @@ class MySQLiResultSet extends ResultSetCommon implements ResultSet {
|
|||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
if ($this->result instanceof mysqli_result) {
|
/**
|
||||||
|
* This is not a definitive solution because there are several behaviors
|
||||||
|
* reported to use the "mysqli_free_result()" function, see
|
||||||
|
* https://bugs.php.net/bug.php?id=63486
|
||||||
|
*/
|
||||||
|
if ($this->result instanceof mysqli_result && isset($this->result->lengths)) {
|
||||||
@mysqli_free_result($this->result);
|
@mysqli_free_result($this->result);
|
||||||
}
|
}
|
||||||
$this->fields = array();
|
$this->fields = array();
|
||||||
|
|||||||
Reference in New Issue
Block a user