我一直在尝试更新由 UPDATE 按钮触发的数据库中的表,但不知何故它不起作用,每当我更改值然后单击更新按钮时,它只会刷新值,不会发生更新/更改..请帮助
<?php
session_start();
require_once("dbconnect.php");
$webhost=$_GET["webhost"];
$requesttitle=$_POST["requesttitle"];
$requesturl=$_POST["requesturl"];
$requestcap=$_POST["requestcap"];
$requestdestype=$_POST["requestdestype"];
$requestdbtype=$_POST["requestdbtype"];
$deptname=$_POST["deptname"];
$contactname=$_POST["contactname"];
$contactnum=$_POST["contactnum"];
$contactemail=$_POST["contactemail"];
$startdate=$_POST["startdate"];
$enddate=$_POST["enddate"];
if(isset($_POST['button']))
{
$sql="update webhostrequest set requesttitle='$requesttitle', ";
$sql.="requesturl='$requesturl', requestcap='$requestcap', ";
$sql.="requestdestype='$requestdestype', requestdbtype='$requestdbtype', ";
$sql.="deptname='$deptname', contactname='$contactname', ";
$sql.="contactnum='$contactnum', contactemail='$contactemail' ';
$sql.="startdate='$startdate', enddate='$enddate', recentact=now() where requestid='$id'";
$result = mysql_query($sql) or die ("Error in editing item. ".mysql_error());
}
header("location: editwebhost.php?webhost=$webhost");
exit;
?>