aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service/Tag2Tag.php
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 15:42:09 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 15:42:09 +0000
commitae8ca8442e93a6e5cb3f1257df0efa3ff1602656 (patch)
tree6c4f5fc9b332975c96ff5621ce3c1a56911ecc4a /src/SemanticScuttle/Service/Tag2Tag.php
parent21db3ef6daeaa4d0da05a7e89c30244e9caff0fd (diff)
downloadsemanticscuttle-ae8ca8442e93a6e5cb3f1257df0efa3ff1602656.tar.gz
semanticscuttle-ae8ca8442e93a6e5cb3f1257df0efa3ff1602656.tar.bz2
Fix *all* unfreed results in unit tests - this was a hard task, but worth it
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@414 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'src/SemanticScuttle/Service/Tag2Tag.php')
-rw-r--r--src/SemanticScuttle/Service/Tag2Tag.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/SemanticScuttle/Service/Tag2Tag.php b/src/SemanticScuttle/Service/Tag2Tag.php
index cc8abb8..dcbcf2e 100644
--- a/src/SemanticScuttle/Service/Tag2Tag.php
+++ b/src/SemanticScuttle/Service/Tag2Tag.php
@@ -39,7 +39,7 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_DbService
$values = array('tag1' => $tag1, 'tag2' => $tag2, 'relationType'=> $relationType, 'uId'=> $uId);
$query = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values);
//die($query);
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not attach tag to tag', '', __LINE__, __FILE__, $query, $this->db);
return false;
@@ -280,7 +280,10 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_DbService
//echo($query."<br>\n");
- return $this->db->sql_numrows($this->db->sql_query($query)) > 0;
+ $dbres = $this->db->sql_query($query);
+ $hasTags = $this->db->sql_numrows($dbres) > 0;
+ $this->db->sql_freeresult($dbres);
+ return $hasTags;
}
function getLinks($uId) {
@@ -290,7 +293,10 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_DbService
$query.= " AND uId = '".$uId."'";
}
- return $this->db->sql_fetchrowset($this->db->sql_query($query));
+ $dbres = $this->db->sql_query($query);
+ $rowset = $this->db->sql_fetchrowset($dbres);
+ $this->db->sql_freeresult($dbres);
+ return $rowset;
}
function removeLinkedTags($tag1, $tag2, $relationType, $uId) {