Ok so I am wondering if there is a simple way to make Addonetothis in my code to add it's current INT + 1 whenever this code is ran?
<?php
$server = "localhost";
$user = "**********";
$pass = "**********";
$dbname = "**********";
//Creating connection for mysqli
$conn = new mysqli($server, $user, $pass, $dbname);
//Checking connection
if ($conn->connect_error) {
die("Connection failed:" . $conn->connect_error);
}
$article_id = $_GET['id'];
if ( ! is_numeric($article_id))
die("Looks like you are lost! <a href='#'>Back to Home</a> ");
$sql = "UPDATE Example SET addonetothis='+ 1' WHERE `ID` =$article_id";
if ($conn->query($sql) === TRUE) {
header("Refresh:1; url=example.php?id=$article_id");
echo "Thank you!";
} else {
echo "Error" . $sql . "<br/>" . $conn->error;
}
$conn->close();