<?php
include "dbconn.php";
$sql = "UPDATE Employee SET firstname = ?, lastname = ?, email = ? WHERE EmployeeID = ?";
$id = $_REQUEST["EmployeeID"];
$firstname = $_REQUEST["firstname"];
$lastname = $_REQUEST["lastname"];
$email = $_REQUEST["email"];
$statement = $conn->prepare($sql);
$statement->bind_param("sssi", $firstname,$lastname,$email,$id);
if ($statement->execute() == TRUE) {
echo "window.location.href = 'employees.php'";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
My connection to the database works fine hence I included my connection php file. I included a line of javascript to redirect me back to the homepage. When I try updating any of my records, I don’t get any errors however the values still remain the same. I’ve trying messing around with my prepared statement but I don’t see any errors in there. Any suggestions would be much appreciated as I’ve been going at this for a few days now thanks!