Mysqli errors: Trying to access array offset on value of type bool. Fixed. Please...
[fa-stable.git] / admin / db / tags_db.inc
index 2ca098043dc74f495465f0800f8d1fd72d4a02ba..40602a942b0c11183582bad6a006eb9a85868f64 100644 (file)
@@ -65,7 +65,7 @@ function get_tag_type($id)
        $result = db_query($sql, "could not get tag type");
 
        $row = db_fetch_row($result);
-       return $row[0];
+       return is_array($row) ? $row[0] : false;
 }
 
 //--------------------------------------------------------------------------------------
@@ -75,9 +75,9 @@ function get_tag_name($id)
        $sql = "SELECT name FROM ".TB_PREF."tags WHERE id = ".db_escape($id);
 
        $result = db_query($sql, "could not get tag name");
-
+       
        $row = db_fetch_row($result);
-       return $row[0];
+       return $row ? $row[0] : '';
 }
 
 //----------------------------------------------------------------------------------------------------
@@ -105,7 +105,7 @@ function get_tag_description($id)
        $result = db_query($sql, "could not get tag description");
 
        $row = db_fetch_row($result);
-       return $row[0];
+       return is_array($row) ? $row[0] : false;
 }
 
 //--------------------------------------------------------------------------------------
@@ -220,4 +220,3 @@ function is_record_in_tags($tags, $type, $recordid)
        return true;
 }
 
-?>
\ No newline at end of file