if (!$modx->db->update($update, $this->tbl["fields"], "id=$id and label='".$update["label"]."'")) $modx->db->insert($update,$this->tbl["fields"]);
$modx->db->update($update,$this->tbl["fields"], "id=$id and label='".$update["label"]."'");
$query=$modx->db->query("SELECT * FROM ".$this->tbl["fields"]." WHERE id=$id and label='".$update["label"]."'");
$limit = $modx->db->getRecordCount($query);
if ($limit<1) {$modx->db->insert($update,$this->tbl["fields"]);}