I am using a form to submit date, subject, content text and an image to mysql using php. I see that all the data get inserted into the DB properly except date which shows up as 0000-00-00
in the table row.
I have unable to figure out how to change date format to be sent to DB.
<form action="#" enctype="multipart/form-data" method="post">
<div class="md-form col-md-6">
<label for="date-picker-example"> Event Date : </label>
<input type="date" name='news_event_date' id="date-picker-example" class="form-control datepicker"/>
</div>
<div class="md-form col-md-6">
<label for="form7">Update Header:</label>
<textarea id="form7" class="md-textarea form-control" rows="1" type="text" name="news_header" ></textarea>
</div>
<div class="md-form col-md-6">
<label for="form8">Update Body:</label>
<textarea type="text" id="form8" class="md-textarea form-control" name="news_body" rows="2" ></textarea>
</div>
<div class="md-form col-md-6">
<label for="form9">Password : </label>
<input id="form9" type="password" name="news_password" class="md-textarea form-control" autocomplete="new-password"/>
</div>
<div class="md-form col-md-6">
<div class="file-field">
<div class="btn btn-primary btn-sm float-left">
<span>Choose files</span>
<input type="file" accept="image/*" name="news_single_file">
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text" placeholder="Upload one or more files">
</div>
</div>
</div>
<button class="btn btn-outline-info btn-rounded btn-block z-depth-0 my-4 waves-effect" type="submit" name="news_submit" value="Subm"/>
<!--//this div is for latest news-->
</form>
All values are updated as required apart from date.