title: Update one or more field ignoring empty field in MySQL
body: <p>Is there a way to update one or more field ignoring the empty fields in MySQL and PHP?</p>
  <p>These are values that I need to enter in a HTML form:</p>
  <pre><code>&lt;input type='text' placeholder='ID' name='ID' value='' id='ID'&gt;
  &lt;input type='text' placeholder='Product name' name='prod_name' value=''&gt;
  &lt;input type='text' placeholder='Description' name='prod_desc' value=''&gt;
  &lt;input type='text' placeholder='Solde price' name='prod_s_price' value=''&gt;
  &lt;input type='text' placeholder='Reg. price' name='prod_r_price' value=''&gt;
  &lt;input type='text' placeholder='Product model' name='prod_mod' value=''&gt;
  </code></pre>
  <p>When I submit the values, they are stored in those variables:</p>
  <pre><code>$prod_id = $_POST['ID']; //Int ID
  $prod_name = $_POST['prod_name']; //String
  $prod_desc = $_POST[&quot;prod_desc&quot;]; //String
  $prod_s_price = $_POST[&quot;prod_s_price&quot;]; //Float
  $prod_r_price = $_POST[&quot;prod_r_price&quot;]; //Float
  $prod_mod = $_POST[&quot;prod_mod&quot;]; //String
  </code></pre>
  <p>When we send the POST request, it goes in a MySQL query:</p>
  <pre><code>if ($_POST['ID'] == null) {
      header('Location: ../index.php?update=error_undefined');
  } else {
  
      $sql = &quot;UPDATE app SET app_name='$prod_name', app_desc='$prod_desc', app_s_price=$prod_s_price, app_r_price=$prod_r_price, app_mod='$prod_mod' WHERE app_id=$prod_id;&quot;;
      $result = mysqli_query($conn, $sql);
  
      header('Location: ../index.php?update=succes');
  }
  </code></pre>