I'm trying to add value to database when each voter will vote with his ID. My db get the value but it goes one row down and i want that the db to get the value 1 to ID row not one row down.
Any solution about this please!!!
This is my code
$before1 = $row['vote_one_before'];
$after1 = $row['vote_one_after'];
$before2 = $row['vote_two_before'];
$after2 = $row['vote_two_before'];
$before3 = $row['vote_three_before'];
$after3 = $row['vote_three_after'];
$vote = 1;
if(($before1 == 0) and ($after1 == 0) and ($before2 == 0) and ($after2 == 0) and ($before3 == 0) and ($after3 == 0)){
$stmt = $conn->prepare("INSERT INTO DB (vote_one_before) VALUES(':vote_one_before')");
$stmt->execute(array(':vote_one_before'=> $vote));
}