Save only day and month in DATE field in mysql with php?

1

I need to register commemorative dates in the database, but I only need the day and month, the year is not relevant and does not need to be registered. My question is, can I save only the day and month in the Date do MYSQL field? or better save in field text? And then recover with the date do php function, because I will need to do a function to calculate that the date is next when there is only 5 days left for it. Example:

<label>Nome Data:
<input type="text" name="data_comemorativa"/>
</label>
<br><br>
<label>Data:
<input type="text" placeholder="dia / mês" name="data"/>
</label>
<br><br>
<button name="Salvar">Salvar</button>

<!--
Depois em php farei a busca no banco todos os dias e farei um alerta para quando estiver faltando apenas 5 dias para o evento e alertado até o dia do evento
"falta 5 dias para...."
"falta 4 dias para ..."
"até o dia do evento"

para o calculo em php vou pegar o ano atual mais o dia e mes vindo do banco.
-->

Or better save the day and month with the current year?

    
asked by anonymous 07.07.2017 / 16:27

1 answer

2

I would personally store with the current year in Date format.

MySql has date functions to retrieve only the month or day from a date so you can do all the calculations in the same, and if for some reason you need the date it's all there to be able to use.

    
07.07.2017 / 16:43