好吧,我不明白为什么不正确执行这一行:
try {
$sql = "UPDATE t_perfiles_permisos
SET :tipo = :valor
WHERE Area_Permiso = :area AND Id_Perfil = :idp";
$result = $this->dbConnect->prepare($sql) or die ($sql);
$result->bindParam(':tipo',$this->tipo,PDO::PARAM_STR);
$result->bindParam(':valor',$this->valor,PDO::PARAM_INT);
$result->bindParam(':area',$this->area,PDO::PARAM_STR);
$result->bindParam(':idp',$this->idp,PDO::PARAM_INT);
$result->execute();
} catch (PDOException $e) {
echo "Error!! No se puede establecer el permiso: ".$e->getMessage()."<br/>";
return false;
}
错误:
Error!! No se puede establecer el permiso: 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 ''Buscar' = '1' WHERE Area_Permiso = 'Perfiles' AND Id_Perfil = '4'' at line 2