<?php
if(isset($_POST['poll'], $_POST['choice']))
{
$poll = $_POST['poll'];
$choice = $_POST['choice'];
$voteQuery = $db->prepare("
INSERT INTO polls_answers (user,poll, choice)
SELECT :user, :poll, :choice
FROM polls
WHERE EXISTS (
SELECT id
FROM polls
WHERE id = :poll
");
$voteQuery->execute([
'user' => $_SESSION['user_id'],
'poll' => $poll,
'choice' => $choice
]);
header('Location:poll.php?poll='.$poll)
}
header('Location:plz.php');
?>
The Program is giving me an error with the last bracket. I don't know what is wrong with the code, everything is together.
Parse error: syntax error, unexpected '}'
Thank you for helping