表单未更新数据库

时间:2019-05-02 00:48:18

标签: php mysql mysqli

我一直在尝试使此表格生效,但找不到答案。我有不同的更新形式可以正常工作,但是这个不是。

我已经尝试使用过以下命令:$abc, '$abc' and "'.$abc.'"。表单没有显示错误,因此一旦我不是php和mysqli的专家,就很难知道。

<?php
}
if(isset($_POST['editcrew'])){

$id      = $_POST['id'];
$name        = $_POST['name'];
$function    = $_POST['function'];
$display     = $_POST['display'];

$query = "UPDATE team SET name = '$name', function = '$function', display = '$display' WHERE id = '$id'";
$retval = mysqli_query($con,$query);

if(! $retval )
{
  die('Oh no! Something is wrong... Try again please!');
} else{
    echo "<div id='loader'></div>";
    echo "<meta http-equiv='refresh' content='2;url=updatehistory.php' />";
}
}
mysqli_close($con);
?>

当我单击更新页面刷新时,而不是转到updatehistory.php

0 个答案:

没有答案