Keeping a date field null after doing a mySQL update

I have a field on form that stores a date. When I pull up one of my users, normally this date field is empty. But as soon as I click the form button’s save button, and an update is made to the users table, that date field then becomes populated with ‘0000-00-00 00:00:00’. What do I need to do to my existing PHP code so that when I do an update, it won’t put those zeros into the database if the field is left blank on the form? I still want the ability to modify a valid date if there is one in the form.


can you simply not set the field as null on the update “UPDATE tablename SET dateinserted = NULL”