title: If one field empty, assign second to variable
body: <p>I'm stuck with a very simple thing. I have two fields (maybe will be 3 later) on one page. Each field opens up by clicking radio button (other fields hide). I want to send field value to database, but i want all values to re-write one another, depending on what field is chosen. I have this code:</p>
  <pre><code>       $get_amount_field = Tools::getValue('amount');
          $get_value = Tools::getValue('formula');
  
          if (isset($get_value)) {
           $name_formatted = str_replace(' 2', '', $get_name);
           $amount=&quot;UPDATE `pr_manufacturer` SET amount = '$get_value' WHERE name = '$name_formatted' &quot;;
           $get_amount = Db::getInstance()-&gt;execute($amount);
          }
          elseif (isset($get_amount_field)) {
           $name_formatted = str_replace(' 2', '', $get_name);
           $amount=&quot;UPDATE `pr_manufacturer` SET amount = '$get_amount_field' WHERE name = '$name_formatted' &quot;;
           $get_amount = Db::getInstance()-&gt;execute($amount);
          }
  </code></pre>
  <p>but it saves only <code>$get_value</code> value. If, for example, <code>$get_value</code> value is none, and <code>$get_amount_field</code> is <strong>25</strong> - after first submit button click database returns old <code>$get_value</code> value, and after second submit with same value of <code>$get_amount_field</code> - database column is just empty. What am I doing wrong perhaps?</p>