  def self.save_group_value(group_id, category, key, value)

    SqlHelper.validate_token([group_id, category, key])

    con = []
    con << "(group_id=#{group_id})"
    con << "(category='#{category}')"
    con << "(xkey='#{key}')"

    setting = Setting.where(con.join(' and ')).first

    if value.nil?
      unless setting.nil?
        setting.destroy
      end
    else
      if setting.nil?
        setting = Setting.new
        setting.group_id = group_id
        setting.category = category
        setting.xkey = key
        setting.xvalue = value
        setting.save!
      else
        setting.update_attribute(:xvalue, value)
      end
    end
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.