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.