这是测试代码,我知道 sql 注入以及如何修复它们。这是一个很长的问题要解释,所以我会尽力而为。
这些是我的数据库中的列
contentid (auto increments with every post, comment, and reply)
hostid (gets the value of the person who uploaded the original post)
postid (gets the value of the post, auto increments with every post)
userid (gets the value of the person who commented or replied)
date (gets the current time)
title (gets the title of the post entered by the host)
description (gets the description of the post entered by the host)
fileid (describes the type of post ex. video, picture, or blog)
commentid (auto increments with every comment)
comment (the actual comment entered by a user)
replyid (auto increments with every reply)
reply (the actual reply entered by a user)
我正在开发一个帖子系统,该系统允许用户发布内容,然后对帖子发表评论或回复帖子中的评论。我有一个名为 posts 的数据库,其中包含所有帖子的评论和回复。如果数据库中没有与帖子具有相同 postid 值的评论,则不应回显任何内容。如果数据库中没有与之前评论具有相同 postid 和 commentid 的回复,则不应回显任何内容。
换句话说,如果没有评论或回复,则不应弹出任何内容。我看到了实际的帖子,但我的数据库中有评论和回复没有显示,有什么想法吗?
慕尼黑8549860