PHP Redemption plus buddy feature

Source: Internet
Author: User
PHP implementation plus buddy feature

Ideas:

1 users send a friend request after the application stored in the Application data sheet, the status is not verified

2 when the user logs in, the query request form has the same UID and the applicant ID, if agreed, change the status, and insert data into the corresponding friend data table otherwise, delete the data in the Request data table

3, when a party deletes a friend, delete the deleted person's friend from the deleted person

4 Create a group Name field, set the value of the field, let the user choose, or let the user customize

5 Listing data table information when querying

Attached: MySQL data sheet total of two

#以上步骤是对数据库的操作, you canclass="inner-link decor-unline"href="/search?word=实例化&fr=qb_search_exp&ie=gbk"target="_blank"rel="nofollow" data-word="2">实例化,

#好友表

class="inner-link decor-unline"href="/search?word=mysql_query&fr=qb_search_exp&ie=gbk"target="_blank"rel="nofollow" data-word="0">mysql_query("CREATE TABLE `t_friend` (

`id` int(11) NOT NULL auto_increment COMMENT '自增id',

`uid` int(11) NOT NULL COMMENT '用户id',

`fid` int(11) NOT NULL COMMENT '好友uid,用,分割,可以有多个',

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#申请表

CREATE TABLE `t_shenqing` (

`id` int(11) NOT NULL auto_increment COMMENT '自增id',

`uid` int(11) NOT NULL COMMENT '被申请用户id userid',

`sid` int(11) NOT NULL COMMENT '好友申请人id',

`text` varchar(255) NOT NULL COMMENT '附言',

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");


Every time a user requests an action, a query or update is made to the database.

1 floor Shooow day before yesterday 12:23
The
implementation method is good.
  • 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.