I'm having this error while trying to run this update:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE [42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id =' 1 '' at line 2 'in C: \ wamp \ www \ siteOriginal \ classes \ official.php on line 65
In case the line 65
is execute, what should I be doing wrong?
public function update($id){
$sql = "UPDATE $this->table SET cargo = :cargo, horastb = :horastb, salario = :salario,
WHERE id=:id";
$stmt = DB::prepare($sql);
$stmt->bindParam(':cargo', $this->cargo);
$stmt->bindParam(':horastb', $this->horastb);
$stmt->bindParam(':sa'insira o código aqui'lario', $this->salario);
$stmt->bindParam(':id', $id);
return $stmt->execute();
}