title: How to ignore empty fields when inserting into MySQL database?
body: <p>I am creating a very basic admin page to control content on another page.</p>
  
  <p>I have a few fields on the admin page, one of which is a file upload field. When the form is submitted the file gets uploaded to a folder and the filename is placed into the database. </p>
  
  <p>The problem is that when somebody goes to the admin page to update the content and they don't upload a file, the filename value gets erased from the database.</p>
  
  <p>Is there a way to do a MySQL query or something else that ignores empty values? </p>
  
  <pre><code>$headerimage=($_FILES['headerimage']['name']); 
  $cktest = $_POST['editor1'];
  $LikeText = $_POST['editor2'];
  
  $sql = "UPDATE installs SET noLikeText = '$cktest', LikeText = '$LikeText', headerImage = '$headerimage' WHERE pageID = '$page_id'";
  </code></pre>