I am trying to update an entry in the database using html and php. However, I keep getting an error saying my sql syntax is wrong.
Here is the code from the php file:
<?php
$server = "127.0.0.1";
$dbUsername = "root";
$dbPassword = "";
//create connection
$dbconn = new mysqli($server, $dbUsername, $dbPassword, $dbname);
$email_follow = $_POST['email_follow'];
$follow = $_POST['follow'];
$update = mysqli_query($dbconn, "UPDATE CustomerDetails SET Follow Up = '$follow' WHERE Email = '$email_follow'");
if ($dbconn->query($update) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $dbconn->error;
}
?>
Here is the html form:
<form action="cust_details_followup.php" method="post">
Email:
<input type="email" name="email_follow" id="email_follow">
Enter Follow Up Details:
<input type="text" name="follow" id="follow">
<input type="submit" value="Update">
</form>
Any help is appreciated. Thank you!