作者:老翅几回寒_332 | 来源:互联网 | 2023-05-16 04:41
my WHERE do so my page dont work and i dont know how i do so then a user create a comment then a number in my thread will grow +1.
我的WHERE这样做我的页面不工作,我不知道我是怎么做的然后用户创建一个评论然后我的线程中的数字将增长+1。
i wanna do this because then i user create a new comment the users who follow that thread can see "oh there is a new comment to the topic o follow"
我想这样做,因为然后我用户创建一个新的评论跟随该线程的用户可以看到“哦有关于该主题的新评论o关注”
here is my code
这是我的代码
if(isset($_POST['opret_kommentar']))
{
$nyt_svar = 0;
$mysql2 = connect();
$stmt2 = $mysql2->prepare("INSERT INTO forum_traad (nyt_svar) VALUES (?) WHERE id = '$traadID'") or die($mysql->error);
$stmt2->bind_param('i', $nyt_svar) or die($mysql->error);
$stmt2->execute();
$indhold = htmlspecialchars($_POST['indhold']);
$godkendt = "ja";
$mysql = connect();
$stmt = $mysql->prepare("INSERT INTO forum_kommentare (fk_forum_traad, brugernavn, indhold, godkendt) VALUES (?,?,?,?)") or die($mysql->error);
$stmt->bind_param('isss', $traadID, $_SESSION['username'], $indhold, $godkendt) or die($mysql->error);
$stmt->execute();
$stmt->close();
$svar = mysqli_insert_id($mysql);
header("location: forum.traad.php?traadID=$traadID&kategoriID=$kategoriID&#$svar");
}
2 个解决方案