SQL syntax error corresponds to MariaDB Server version.
I am getting an error which says "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(Username,Email,EmployeeID,Designation,Password, WHERE Id = '7'' at line 1".
I tried with some solutions, but I didn't fixed it. Please give solution for this and also explain something about this. My code is:
PHP Code:
<?php
session_start();
$id=$_SESSION['Id'];
if(isset($_POST)){
require '../_database/database.php';
$username = $_REQUEST['Username'];
$email = $_REQUEST['Email'];
$employee = $_REQUEST['EmployeeID'];
$designation = $_REQUEST['Designation'];
$password = $_REQUEST['Password'];
$query = "UPDATE users SET (Username,Email,EmployeeID,Designation,Password, WHERE Id = '$id'";
$stmt = mysqli_prepare($database,$query)or die(mysqli_error($database));
$stmt->bind_param('sssss', $username, $email, $employee, $designation, $password);
$stmt->execute();
//header("location:../user.php?Username=$temp&request=profile-update&status=success");
}
?>