From c0e46287e41ac5be4c4832c915c8e2ba78b9a1d5 Mon Sep 17 00:00:00 2001 From: mensonge Date: Tue, 3 Feb 2009 15:32:23 +0000 Subject: Refactoring: free few sql results git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@247 b3834d28-1941-0410-a4f8-b48e95affb8f --- services/searchhistoryservice.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'services/searchhistoryservice.php') diff --git a/services/searchhistoryservice.php b/services/searchhistoryservice.php index 72ea825..91457e8 100644 --- a/services/searchhistoryservice.php +++ b/services/searchhistoryservice.php @@ -72,16 +72,17 @@ class SearchHistoryService { while ($row = & $this->db->sql_fetchrow($dbresult)) { $searches[] = $row; } + $this->db->sql_freeresult($dbresult); return $searches; } function countSearches() { $sql = 'SELECT COUNT(*) AS `total` FROM '. $this->getTableName(); - if (!($result = & $this->db->sql_query($sql)) || (!($row = & $this->db->sql_fetchrow($result)))) { + if (!($dbresult = & $this->db->sql_query($sql)) || (!($row = & $this->db->sql_fetchrow($dbresult)))) { message_die(GENERAL_ERROR, 'Could not get total searches', '', __LINE__, __FILE__, $sql, $this->db); return false; } - + $this->db->sql_freeresult($dbresult); return $row['total']; } -- cgit v1.2.3