Php cash-and-friend feature

Source: Internet
Author: User
Php: 1. after a user sends a friend application, the application is stored in the application data table in the status of & nbsp; not verified. 2 & nbsp; when the user logs on, check whether the uid in the application form is the same as the id of the respondent. if you agree, change the status and insert the data to the corresponding friend data table. otherwise, delete data 3 in the application data table, when one party deletes a friend, it deletes php from the deleted person to add a friend.

Ideas:

1. after a user sends a friend application, the application is stored in the application data table and the status is not verified.

2. when a user logs on, check whether the uid in the application form is the same as the id of the respondent. if you agree, change the status and insert the data to the corresponding friend data table. otherwise, delete data from the application data table

3. when one party deletes a friend, the deleted friend is deleted from the deleted person.

4. create a group name field. set the value of the field to allow the user to select or customize the field.

5. list data table information during query

Appendix: two mysql data tables

# The above steps are for database operations. you canclass="inner-link decor-unline"href="/Search? Word = instantiation & fr = qb_search_exp & ie = gbk"target="_blank"rel="nofollow" data-word="2"> Instantiation,# Friend tableclass="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 'Auto-increment ID',  `uid` int(11) NOT NULL COMMENT 'User ID',  `fid` int(11) NOT NULL COMMENT 'Friends uid, separated by, can have multiple',  PRIMARY KEY  (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;# Application FormCREATE TABLE `t_shenqing` (  `id` int(11) NOT NULL auto_increment COMMENT 'Auto-increment ID',  `uid` int(11) NOT NULL COMMENT 'Applied user ID userid',  `sid` int(11) NOT NULL COMMENT 'Friend applicant ID',  `text` varchar(255) NOT NULL COMMENT 'Postscript',  PRIMARY KEY  (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");


Each user request operation queries or updates the database,

Shooow, 1st floor, the day before yesterday
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.