第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

為什么我的代碼不能正確顯示評(píng)論和回復(fù)?

為什么我的代碼不能正確顯示評(píng)論和回復(fù)?

PHP
森林海 2021-06-18 18:27:36
這是測試代碼,我知道 sql 注入以及如何修復(fù)它們。這是一個(gè)很長的問題要解釋,所以我會(huì)盡力而為。這些是我的數(shù)據(jù)庫中的列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)我正在開發(fā)一個(gè)帖子系統(tǒng),該系統(tǒng)允許用戶發(fā)布內(nèi)容,然后對帖子發(fā)表評(píng)論或回復(fù)帖子中的評(píng)論。我有一個(gè)名為 posts 的數(shù)據(jù)庫,其中包含所有帖子的評(píng)論和回復(fù)。如果數(shù)據(jù)庫中沒有與帖子具有相同 postid 值的評(píng)論,則不應(yīng)回顯任何內(nèi)容。如果數(shù)據(jù)庫中沒有與之前評(píng)論具有相同 postid 和 commentid 的回復(fù),則不應(yīng)回顯任何內(nèi)容。換句話說,如果沒有評(píng)論或回復(fù),則不應(yīng)彈出任何內(nèi)容。我看到了實(shí)際的帖子,但我的數(shù)據(jù)庫中有評(píng)論和回復(fù)沒有顯示,有什么想法嗎?
查看完整描述

1 回答

?
慕尼黑8549860

TA貢獻(xiàn)1818條經(jīng)驗(yàn) 獲得超11個(gè)贊

看起來這部分... AND postid = 'postid' AND ...應(yīng)該是... AND postid = '$postid' AND ...

您的查詢正在查找具有postid ==(字符串)“postid” 而不是 postid ==(值)$postid 的記錄,如您所愿。


查看完整回答
反對 回復(fù) 2021-06-25
  • 1 回答
  • 0 關(guān)注
  • 104 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)