How to implement comment reply and delete function in PHP? This article mainly introduces the comment reply and delete function in PHP in detail. It has certain reference value. Interested friends can refer to it. I hope to be helpful.
Simple comment reply and delete function, the specific content is as follows
1. Database
Create two tables, one is the pinglun table; the other is huifu Table
## The effect is as follows: The code is as follows: 1. Main page main.phpquery($sql,1); foreach($arr as $v) { echo"无标题文档 朋友圈
内容:
今天很嗨
{$v[1]} {$v[3]}
{$v[2]}
"; $dc = new DBDA(); $sql1 ="select * from huifu where jieshouid ={$v[0]}"; //查询回复表中的id和传过去的id是不是一样的 $arr1 = $dc->query($sql1,1); foreach($arr1 as $k) { echo "{$k[2]} {$k[3]}
{$k[4]}
"; } } ?>query($sql); header("location:main.php");
query($sql); header("location:main.php");
query($sql)) { header("location:main.php"); } else { echo "删除失败!"; }
Related recommendations:
thinkphp5 method of uploading images and generating thumbnails
Detailed explanation of how PHP implements a simple search box automatic prompt function
Detailed explanation of how PHP obtains the audio file duration
The above is the detailed content of Detailed explanation of how to implement comment reply and delete function in PHP. For more information, please follow other related articles on the PHP Chinese website!