PMA_DBI_free_result() now accepts more than one resource to be freed

This commit is contained in:
Sebastian Mendel
2005-12-09 10:04:01 +00:00
parent a50b2c495a
commit 12f1164148
3 changed files with 28 additions and 12 deletions

View File

@@ -144,11 +144,17 @@ function PMA_DBI_fetch_row($result) {
return PMA_mysql_fetch_array($result, MYSQL_NUM);
}
function PMA_DBI_free_result($result) {
if (!is_bool($result)) {
return mysql_free_result($result);
} else {
return 0;
/**
* Frees the memory associated with the results
*
* @param result $result,... one or more mysql result resources
*/
function PMA_DBI_free_result() {
foreach ( func_get_args() as $result ) {
if ( is_resource($result)
&& get_resource_type($result) === 'mysql result' ) {
mysqli_free_result($result);
}
}
}