There is a date field in my webpage that uses the JavaScript calendar format of the date field on the web page MM / DD / YYYY When the user enters all the information and submits the hit, all the fields except the fields corresponding to the date are updated. Here are the details:
HTML:
< Code> & lt; Tr & gt; & Lt; Td> & Lt; Label & gt; & Lt; Font color = "red" & gt; * & Lt; / Font & gt; Date: & lt; / Label & gt; & Lt; / Td> & Lt; Td> & Lt; Input name = "date" value = "choose date" id = "popupdate picker" & gt; & Lt; / Td> & Lt; / TR & gt;PHP code:
MySQL:
USER_DATE: DATETIME datatype
When a new record is entered, USER_DATE shows
0000-00-00 00:00:00 as the value also when the date fields on the UI side Get population
Can someone guide me in the form of trouble here. <
uses MM / DD / YYYY mitochoom Which is not a datetime format.
Try it ...
Date ('Ym-D', Stratom ($ date));
example
$ date = '02 / 07/2011 '; $ SqlDate = Date ('Y-M-D', Stromatium ($ date)); Var_dump ($ sqlDate); // string (10) "2011-02-07"
.
Comments
Post a Comment