Page 1 of 1

Insert different dates into a database table.

Posted: Tue Apr 25, 2006 3:21 pm
by mattyboi
Hello,

I have a form with serveral different date fields. I would like to insert these into a table, along with other info, but in the proper MySQL date format.

My users will be inputing the dates in this format (mm/dd/yy). How would I format this to insert them into the table in the proper DATE fomat.

*NOTE each date field in the database had the DATE type.

Thanks

Posted: Tue Apr 25, 2006 3:24 pm
by feyd
explode() it, reassemble them in proper order and add the correct leading time to the year.

Posted: Tue Apr 25, 2006 4:04 pm
by mattyboi
That worked great thanks.

Once I format the date correctly 0000-00-00, will it just insert correctly into the DATE type field?

Posted: Tue Apr 25, 2006 4:17 pm
by feyd
try it. :)