Points handling solution

Source: Internet
Author: User
Points handling members log on only once on the same day, how to handle it, find the idea, the timestamp of the last database logon time type, and record the time and ip address. Determine whether the ip address exists today. Do not accumulate points, explore reference: record time and ip. Determine whether the ip address exists today. If it does not exist, add points. then, change the IP address to log on ., In fact, I think credits can be processed using online time.
The member logs in only once on the same day. how can this problem be solved? the time stamp of the last database logon time type?

------ Solution --------------------
Record the time and ip address. Determine whether the ip address exists today. Accumulate points only when the point does not exist
------ Solution --------------------
Discussion

Reference:

Record the time and ip address. Determine whether the ip address exists today. Accumulate points only when the point does not exist


Change the IP address to log on.

------ Solution --------------------
In fact, I think it's okay to use online time, that is, how long it takes to get online today. as long as there is online time, it means that he hasn't logged on.
------ Solution --------------------

Points are added when the last time obtained is less than date ('Y-m-D', time ().

Change the last logon time of the member.


Discussion

Reference:

Reference:

Reference:

Record the time and ip address. Determine whether the ip address exists today. Accumulate points only when the point does not exist


Change the IP address to log on.


It turns out to be a member. You don't need to use the ip address to determine the time and membership.


Ask again. can you give me more details and determine if the user is logged on the same day? that is, points can be added from.

------ Solution --------------------
1. create a database table check with the member and time fields. you can add other fields as needed.
2. when a member logs on, check whether the member has logged on today (select * from check where member = '$ user' and time =' $ now '). If yes, the member will not perform the points operation, if it does not exist, perform the point operation and insert the member name and time to the check table today.
(Insert into check ('member', 'time') values ('$ user',' $ now '))
3. for database optimization, it is recommended to regularly clean the check table (for example, once a day: delete from check where time)
------ Solution --------------------
Time comparison
------ Solution --------------------
The above is the pseudocode, just to make you better understand
You may need to modify it.
------ Solution --------------------
Test Reply

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.