管理员更新后我的数据库没有更新,例如更改活动名称等等
这是代码的一部分:
displayEventData :中的
<?php
//write qry
$qry="SELECT * FROM event WHERE id='".$_POST['country_id']."'";
//run qry
$result=mysql_query($qry);
//print
$row=mysql_fetch_array($result);
Print '<br/>Event Name: <input type="text" name="newEventName" value="' .$row['name'].'"><br/>';
Print 'Event Description: <input type="text" name="newEventDescription" value="'.$row['description'].'"><br/>';
Print 'Event Location: <input type="text" name="newEventLocation" value="' .$row['location'].'"><br/>';
Print 'Event Date: <input type="text" name="newEventDate" value="' .$row['date'].'"><br/>';
Print 'Event Time: <input type="text" name="newEventTime" value="' .$row['time'].'"><br/>';
?>
在executeEdit.php中:
$name = $_POST['newEventName'];
$description = $_POST['newEventDescription'];
$location = $_POST['newEventLocation'];
$date = $_POST['newEventDate'];
$time = $_POST['newEventTime'];
//Create query
$qry="UPDATE event SET name='".$name."',description='".$description."',location='".$location."',date='".$date."',time='".$time."' WHERE id='".$_GET['country_id'].'">';
$result=mysql_query($qry);