I wrote a calendar using js. How does php implement the sign-in records on the calendar and how does Mysql store the sign-in information? What should I do when I sign in to a php calendar?
I wrote a calendar using js. How does php implement the sign-in records on the calendar and how does Mysql store the sign-in information?
What should I do when I sign in to a php calendar?
Reply content:
I wrote a calendar using js. How does php implement the sign-in records on the calendar and how does Mysql store the sign-in information?
What should I do when I sign in to a php calendar?
Well, I have met this before.
The check-in table is huge.
If there are 10 users within 30 days of a month, there will be 300 records.
Data interaction is naturally ajax.
Another storage method is to throw it to mongodb.
Create a new sign-In table, store information such as the sign-in date, and then listen to the click events of each day in your calendar. Can I submit them through ajax? (the server time is used when saving)
Redis can be used for storage. A key: value key-value pair is created every month. For example, in the first month, sign: 111: 1 is used to indicate the user ID and sign-in month respectively, and then value is queue, end the data for each sign-in to the end of the queue. You can query the key of this month every time you need to display the sign-in table.
When you initialize the calendar, check whether you have signed in on the current day (compare the data in the database on the current day of the calendar). If you sign in on the current day, add Class indicates that you have already signed in! Otherwise, continue. How do you do it when initializing the calendar? You can paste it.