Hello all, 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.
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"
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");
}