Reputation: 279
I have a form, that saves date of birth in the database. This form passes three variables to php: $ayear $amonth $adate Now I need to save these in the database in a format: 00/00/0000 (or 00/00/00, if 00/00/0000 is not supported). I need to create a date() variable, but I dont know how. All the examles on the internet use time() or now() which are not usefull in my case. Can someone give me the right function? Thank you for your time!
Upvotes: 0
Views: 148
Reputation: 32921
If you're using MySQL you'll want to save as YYYY-MM-DD
with the field type set to date. I'd save this variables value to the database.
$birthday = implode('-', array($year, $month, $day));
Upvotes: 1