title: how to update one or more fields ignoring the empty fields into mysql database?
body: <p>i am seeking help on ignoring null values for updating the mysql database:-</p>
  
  <pre><code>$cst = $_POST['custname'];
  $a = $_POST['tel'];
  $b = $_POST['fax'];
  $c = $_POST['email'];
  $sql = mysql_query("UPDATE contacts SET TEL = '$a', FAX = '$b', EMAIL = '$c'
                      WHERE Cust_Name = '$cst' ");
  </code></pre>
  
  <p>how do i incorporate an option where the user can only select one or all fields for updation.</p>
  
  <p>i tried using the following code based on responses received but it does the same thing. overwrites the existing data with the blank ones.</p>
  
  <pre><code>$upd = mysql_query("UPDATE custcomm_T SET 
  Telephone = ".(is_null($a)?'Telephone':"'$a'").",
  Fax = ".(is_null($b)?'Fax':"'$b'").",
  Mobile = ".(is_null($c)?'Mobile':"'$c'").",
  EMail = ".(is_null($d)?'EMail':"'$d'").",
  trlicense = ".(is_null($e)?'trlicense':"'$e'").",
  trlicexp = ".(is_null($f)?'trlicexp':"'$f'")."
  WHERE Cust_Name_VC = '$g' ") or die(mysql_error());
  </code></pre>