我不知道我做错了什么。任何人都可以帮助我。
function updateSerie($id, $serie, $description, $seasons, $genre, $avatar) {
include("connect.php");
$sql = "UPDATE Series SET Serie=\'".$serie."\', Description=\'".$description."\', Seasons=".$seasons.", Genre=\'".$genre."\', AvatarLink=\'".$avatar."\' WHERE SerieID=".$id;
if (!mysqli_query($mysqlConnection,$sql)) {
die('Error: '. mysqli_error($mysqlConnection));
}
}
答案 0 :(得分:3)
$sql = "UPDATE Series SET Serie='".$mysqlConnection->real_escape_string($serie)."', Description='".$mysqlConnection->real_escape_string($description)."', Seasons='".$mysqlConnection->real_escape_string($seasons)."', Genre='".$mysqlConnection->real_escape_string($genre)."', AvatarLink='".$mysqlConnection->real_escape_string($avatar)."' WHERE SerieID='".$mysqlConnection->real_escape_string($id)."'";
你为什么逃到这里?没有这些无用的反斜杠它应该工作(并且不要忘记mysqli_real_escape_string()
!)