mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
Merge pull request #3366 from marc1706/ticket/13348
[ticket/13348] Use close method to free feed query result handle * marc1706/ticket/13348: [ticket/13348] Remove unnecessary global $cache [ticket/13348] Use close method to free query result handle
This commit is contained in:
commit
8832851b8e
1 changed files with 6 additions and 5 deletions
|
@ -67,6 +67,9 @@ abstract class base
|
||||||
*/
|
*/
|
||||||
var $separator_stats = "\xE2\x80\x94"; // —
|
var $separator_stats = "\xE2\x80\x94"; // —
|
||||||
|
|
||||||
|
/** @var mixed Query result handle */
|
||||||
|
protected $result;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
@ -229,9 +232,7 @@ abstract class base
|
||||||
|
|
||||||
function get_item()
|
function get_item()
|
||||||
{
|
{
|
||||||
static $result;
|
if (!isset($this->result))
|
||||||
|
|
||||||
if (!isset($result))
|
|
||||||
{
|
{
|
||||||
if (!$this->get_sql())
|
if (!$this->get_sql())
|
||||||
{
|
{
|
||||||
|
@ -240,10 +241,10 @@ abstract class base
|
||||||
|
|
||||||
// Query database
|
// Query database
|
||||||
$sql = $this->db->sql_build_query('SELECT', $this->sql);
|
$sql = $this->db->sql_build_query('SELECT', $this->sql);
|
||||||
$result = $this->db->sql_query_limit($sql, $this->num_items);
|
$this->result = $this->db->sql_query_limit($sql, $this->num_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->db->sql_fetchrow($result);
|
return $this->db->sql_fetchrow($this->result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function user_viewprofile($row)
|
function user_viewprofile($row)
|
||||||
|
|
Loading…
Add table
Reference in a new issue