Answer the question
In order to leave comments, you need to log in
What is the best way to store a birthday in MySQL?
It is necessary to make it possible to indicate in the questionnaire separately the year of birth, separately the day of birth (day + month), and with the possibility of not specifying one of the parameters, as well as with a search by range, for example, from October 3 to November 13. What is the best way to keep a birthday? If DATE, then an unnecessary year will be stored there, and it must be selected as a leap year so that February 29 is recorded. And it's hard to compare values.
Answer the question
In order to leave comments, you need to log in
Birthday (year, month, day) is better stored in DATE, obviously. Do not break them into columns, but operate on the data inside the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question