Bug fix: correct bug into description of tag
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@278 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
edddedaa94
commit
0a7fb9da2e
1 changed files with 19 additions and 2 deletions
|
@ -33,6 +33,24 @@ class TagService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function existsDescription($tag, $uId) {
|
||||||
|
$query = 'SELECT tag, uId, tDescription';
|
||||||
|
$query.= ' FROM '.$this->getTableName();
|
||||||
|
$query.= ' WHERE tag = "'.$tag.'"';
|
||||||
|
$query.= ' AND uId = "'.$uId.'"';
|
||||||
|
|
||||||
|
if (!($dbresult = & $this->db->sql_query($query))) {
|
||||||
|
message_die(GENERAL_ERROR, 'Could not get tag description', '', __LINE__, __FILE__, $query, $this->db);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($row =& $this->db->sql_fetchrow($dbresult)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getAllDescriptions($tag) {
|
function getAllDescriptions($tag) {
|
||||||
$query = 'SELECT tag, uId, tDescription';
|
$query = 'SELECT tag, uId, tDescription';
|
||||||
$query.= ' FROM '.$this->getTableName();
|
$query.= ' FROM '.$this->getTableName();
|
||||||
|
@ -47,8 +65,7 @@ class TagService {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDescription($tag, $uId, $desc) {
|
function updateDescription($tag, $uId, $desc) {
|
||||||
$objectTag = $this->getDescription($tag, $uId);
|
if($this->existsDescription($tag, $uId)) {
|
||||||
if(count($objectTag)>0 ) {
|
|
||||||
$query = 'UPDATE '.$this->getTableName();
|
$query = 'UPDATE '.$this->getTableName();
|
||||||
$query.= ' SET tDescription="'.$this->db->sql_escape($desc).'"';
|
$query.= ' SET tDescription="'.$this->db->sql_escape($desc).'"';
|
||||||
$query.= ' WHERE tag="'.$tag.'" AND uId="'.$uId.'"';
|
$query.= ' WHERE tag="'.$tag.'" AND uId="'.$uId.'"';
|
||||||
|
|
Loading…
Reference in a new issue