Reputation: 221
I am saving days in my database but my problem is I shouldn't be able to save the same day.
It successfully saves because they both read "Sunday". How can I code such that the Sunday in the database saved last week is different from "Sunday" today, and so on?
Upvotes: 1
Views: 54
Reputation: 41490
Record meta-data for each save giving the date on which you are saving it, not the day of the week.
Then before you save a new day, verify that you have not yet saved a record for that date.
Upvotes: 1