summaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service/TagCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/SemanticScuttle/Service/TagCache.php')
-rw-r--r--src/SemanticScuttle/Service/TagCache.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/SemanticScuttle/Service/TagCache.php b/src/SemanticScuttle/Service/TagCache.php
index 9e8b298..7908ae3 100644
--- a/src/SemanticScuttle/Service/TagCache.php
+++ b/src/SemanticScuttle/Service/TagCache.php
@@ -121,8 +121,10 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_DbService
//echo($query."<br>\n");
- return $this->db->sql_numrows($this->db->sql_query($query)) > 0;
-
+ $dbres = $this->db->sql_query($query);
+ $rows = $this->db->sql_numrows($dbres);
+ $this->db->sql_freeresult($dbres);
+ return $rows > 0;
}
/*
@@ -221,7 +223,10 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_DbService
$query.= " AND relationType = '='";
$query.= " AND uId = '".$uId."'";
- return $this->db->sql_numrows($this->db->sql_query($query)) > 0;
+ $dbres = $this->db->sql_query($query);
+ $rows = $this->db->sql_numrows($dbres);
+ $this->db->sql_freeresult($dbres);
+ return $rows > 0;
}
function _isSynonymValue($tag2, $uId) {
@@ -233,7 +238,10 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_DbService
$query.= " AND relationType = '='";
$query.= " AND uId = '".$uId."'";
- return $this->db->sql_numrows($this->db->sql_query($query)) > 0;
+ $dbres = $this->db->sql_query($query);
+ $rows = $this->db->sql_numrows($dbres);
+ $this->db->sql_freeresult($dbres);
+ return $rows > 0;
}
function getSynonyms($tag1, $uId) {
@@ -252,7 +260,7 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_DbService
$tagservice =SemanticScuttle_Service_Factory::get('Tag');
$tag2 = $tagservice->normalize($tag2);
- if($this->_isSynonymKey($tag2)) return $tag2;
+ if($this->_isSynonymKey($tag2, $uId)) return $tag2;
if($tag2 == '') return false;