I have date field in my MySQL DB and three fields (yyyy-mm-dd) in my PHP form. The user would set a complete date but can also set a "yyyy-mm" or "yyyy" date. In MySQL everything is going right, if the user only set the year, it store "yyyy-00-00". So as there is no 00 day in a month and no 00 month in a year, it acts like a "NULL" day or month.
But, when i want to display de date back to the user, using th date_format PHP function, if the date is "2012-00-00", it display "2011-12-30".
How can I easily (not using have_day and have_month columns in the db) handled this behaviour?
Thanks in advance!