title: Make MySQL default to a NULL when an enum field is set to an invalid value
body: <p>Is there a way to make MySQL default to a NULL when an enum field is set to an invalid value?</p>
  
  <p>Also, is there a way I can specify a value in an HTML form such that, when saved to the DB, it stores as a NULL. I don't want to do any checks like "if empty string, then save a NULL." If it's possible, is it a good idea? Any security concerns?</p>
  
  <p>My scenario: I have an HTML drop down menu that has an "null" option followed by a list of items that correspond to the DB's enum. When the null option is selected and saved, I want it to reflect as a NULL in the DB. Right now, it's being converted to an empty string, as per:</p>
  
  <blockquote>
    <p>If you insert an invalid value into an ENUM (that is, a string not
    present in the list of permitted values), the empty string is inserted
    instead as a special error value. This string can be distinguished
    from a “normal” empty string by the fact that this string has the
    numeric value 0.</p>
  </blockquote>
  
  <p><a href="http://dev.mysql.com/doc/refman/5.5/en/enum.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.5/en/enum.html</a></p>