PHP/MySQL Date Issue

by 7 replies
9
Here's my problem...

I'm trying to have users input their birthday via an html form in a particular format: DD-MM-YYYY

Then I want to INSERT that into my DB under the column: birthdate.

It seems that MySQL wants dates formatted in the YYYY-MM-DD format. How to I collect that information as a $string, and then convert it into the correct format?

I admit, I'm a novice at PHP and MySQL...this one has stumped me.

Anyone care to help?
#programming #date #issue #php or mysql
  • I can help.
    Is your html form ready to take the date? or that also needs to be created ?
    Give me your html code i will add the php into that.
  • Have three fields (month, date and year). After that you can concatenate it any way you want
    • [ 1 ] Thanks
    • [1] reply
    • Thanks - That works fine...
      • [1] reply
  • yes..just explode the date input value and implode it in req format [ie yyyy-mm-dd] for mysql and insert

Next Topics on Trending Feed