Php followers/each time a fan is added, there will be a prompt

Source: Internet
Author: User
Every added fan of php followers will have a prompt. This post was last edited by u012376806 at 19:17:32 on.

Currently, the following is a separate table structure:

Gzid userid followuserid remark in_time

Gzid auto-increment
Userid: User id
Followuserid: id of the person to be followed
Remark remarks
In_time follow time

How can I add n followers after being followed?
There is also how to prevent users from constantly paying attention to and canceling a user's attention.


Reply to discussion (solution)

1. after being followed, the system prompts the host? Difference between new data and data output in a certain period of time

2. determine whether the operation is permitted by the timestamp within a period of time

Make a judgment before following and canceling the follow.

1. after being followed, the system prompts the host? Difference between new data and data output in a certain period of time

2. determine whether the operation is permitted by the timestamp within a period of time

How do I write a query statement for mysql to query data 30 minutes ago? unix timestamp

Query the number of fans whose current id is 1
Select count (*) as totalb from pd_attentions where followuserid = '1'

Query the number of followers whose id is 1 30 minutes ago
Select count (*) as totalb from pd_attentions where followuserid = '1' in_time

Select count (*) as totalb from pd_attentions where followuserid = '1' and in_time <DATE_SUB (CURDATE (), INTERVAL 30 SECOND)

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.