I want to store html input type month(month and year only) in adminer(db.php) using spring framework.But there is no such data type for month and year only in adminer, if i store month and year using date datatype it automatically set the date 1st of every month but i need month and date only. can anybody please help me on this ?
Asked
Active
Viewed 76 times
1 Answers
0
It is not a problem of Adminer, there is no such data type in MySQL (or whatever DB you are using). You can use date (YYYY-MM-DD) or datetime (YYYY-MM-DD HH:MM:SS). Either save the data to date type and ignore the day part, or use two int columns, one for month, one for year.

Ondra Koupil
- 1,034
- 6
- 9
-
Thanks for your prompt reply, I have already used date type for input, i have only one input field for month and year(both) and i can't use two int columns for month and year as its impossible to create 2 getter setters for the one input field, so suggest me some other option or its ok i can manage it with date type. – Preet Singh Jun 29 '17 at 07:12