关于一个博客的功能代码,该如何处理

WBOY
Release: 2016-06-13 10:17:01
Original
687 people have browsed it

关于一个博客的功能代码
怎么添加文章的时候,再根据该文章创建一个对应该文章的表做评论用??说说大家的思路




我的意思是添加文章的时候同时添加对应的表??

------解决方案--------------------
数据库中有触发器这个功能可以实现你的想法。
但让我不解的是,为什么你不专门建一个评论表,存放文章的id,评论内容。 当获取某篇文章评论的时候,根据其文章id获取不就完了。
为什么一篇文章对应一个评论表呢?
------解决方案--------------------
要是按你那样。数据库会爆炸的。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!