应用背景WEB网页开发-网上论坛系统,基于博主发帖,游客看帖并对自己喜欢的帖子进行评论以及博主的相应反馈。同时也可以供用户对自己喜欢的帖子类型进行搜索。关键技术
回帖关键技术:
首先得设计好数据库,留言一个表,回复一个表,然后把留言表中关键字ID关联到回复表中。
比如:
留言表:message
id
contents
user
time
回复表:reply
id
m_id 关联留言表中的id
contents
user
time
然后程序方面把对应的留言、回复保存到相应的表中,读取的时候先遍历留言表,然后通过留言表id再读取对应的回复数据。
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.000999s ]
SELECT `a`.`aid`,`a`.`title`,`a`.`create_time`,`m`.`username` FROM `jrk_downrecords` `a` INNER JOIN `jrk_member` `m` ON `a`.`uid`=`m`.`id` WHERE `a`.`status` = 1 GROUP BY `a`.`aid` ORDER BY `a`.`create_time` DESC LIMIT 10 [ RunTime:0.062625s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.001202s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.001236s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.001076s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.003169s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.000791s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.003728s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.013940s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001177s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 80463 [ RunTime:0.025652s ]