jeff5656 Posted June 28, 2009 Share Posted June 28, 2009 One of my table variabes, remove_date is in DATE format. When I process the form below remove_date is 000-00-00, even though the if statement is true. (When I echo remove_date it comes back as 6/27/09.) $signoff_status = $_POST['signoff_status']; if($signoff_status =='s'){ $remove_date = date ("m/d/y"); } $sql = "UPDATE transfer SET origin = '$origin', patient = '$patient', contact = '$contact', mrn = '$mrn', reason = '$reason', info = '$info', priority='$priority', remove= '$remove', comments='$comments', comments_date = '$comments_date', info_date='$info_date', remove_date = '$remove_date', signoff_status='$signoff_status' WHERE id_incr = '$id_incr'"; Quote Link to comment https://forums.phpfreaks.com/topic/163979-solved-date-gets-stored-as-000-00-00/ Share on other sites More sharing options...
jeff5656 Posted June 28, 2009 Author Share Posted June 28, 2009 I had to change it to date("Y-m-d H:i:s") to get it to work Quote Link to comment https://forums.phpfreaks.com/topic/163979-solved-date-gets-stored-as-000-00-00/#findComment-865061 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.