I use the same PHP code for all of my SQL requests on this project. However, the one I am writing up to update my tables is throwing back errors. Here is the section where I post the headers and write up the SQL request:
$query = $conn->prepare('UPDATE personnel AS p
SET p.firstName = ?, p.lastName = ?, p.jobTitle = ?,
p.email = ?, l.name = ?, d.name = ?
INNER JOIN department AS d ON p.departmentID=d.id
INNER JOIN location AS l ON d.locationID=l.id
WHERE p.id = ?');
$id = $_POST['one'];
$fName = $_POST['two'];
$lName = $_POST['three'];
$job = $_POST['four'];
$email = $_POST['five'];
$dep = $_POST['six'];
$loc = $_POST['seven'];
$query->bind_param("sssssss", $fName, $lName, $job, $email,
$loc, $dep, $id);
$query->execute();
I have also tried entering bind param as "ssssssi" even though the number is in string format. I entered all of the POST headers as variables; it doesn't seem to like me throwing them straight into the bind_param.
Here are my console and network responses: (name, email, etc are fictional)