i am trying to add to an int and than update the int where the name = $loginuser but i get a 500 error i do not know what i did wrong big change i did something stupid. i also do not know hot to do math in php script also whatever i try i can not update the value in the database.
the code:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//database info
$servername = "localhost";
$username = "Transact";
$password = "FaTRwwvJHLPXWtR6";
$dbname = "puntsysteem";
//by user
$loginUser = $_POST["loginUser"];
$transactPoint = $_POST["transactPoint"];
//create Connection
$conn = new mysqli($servername, $username, $password, $dbname);
//check Connection
if($conn->connect_error) {
die("Connection Failed: " . $conn->connect_error);
}
$stmt = $conn->prepare("UPDATE user SET punten = punten + ? WHERE naam = ?");
$stmt->bind_param("is", $transactPoint, $loginUser);
$stmt->execute();
$stmt->close();
$conn->close();
?>
any suggestions?