I have been trying to figure it out with searches, but I am running into deprecated code and conflicting advice.
I am trying to select the number of yes votes with an ID that is passed through the url. I want to then add one to that number and UPDATE the table. I'm not quite sure exactly where I've gone wrong.
EDIT: I have tried using yesvotes=yesvotes +1 and that gets me from 0 to 1 but will not get me from 1 to 2 or any further. I just need a clicked link (which passes the needed 'ID' through the URL and retrieved using $_GET) to add 1 to the 'yesvotes' column. I thought it was a straightforward process but it seems like I am missing something or have a syntax error somewhere.
Sorry for the newb shit, just trying to learn.
<?php
$entry = $_GET ['id'];
include 'connect.php';
$result = $mysqli->query("SELECT * FROM yesvotes WHERE ID = '" . $entry ."'");
$vote = $result->fetch_array();
$votetotal = $vote++;
$sql =
"UPDATE showsubmit
SET yesvotes = '" . $votetotal . "'
WHERE ID = '" . $entry . "'";
$conn->query($sql);
$conn->close();
?>