我正在尝试通过提交表单数据在数据库中创建一个新条目。它完成了整个代码而没有任何错误,但没有在数据库中显示任何新元素。
有人知道发生了什么吗?
}elseif(isset($_GET["new"])){//add new
if($_GET['changeme']=="yes") //if user pressed save, then update table
{
$name = $_POST["name"];
$active = $_POST["active"];
$email = $_POST["email"];
$training = $_POST["training"];
$trials = $_POST["trials"];
$BHV = $_POST["BHV"];
$tours = $_POST["tours"];
$pasnr = $_POST["pasnr"];
$pasactivated = $_POST["pasactivated"];
$pastested = $_POST["pastested"];
mysql_query("INSERT INTO Members (name, active, email, training, trials, BHV, tours, pasnr, pasactivates, pastested) VALUES
('$name', '$active', '$email', '$training', '$trials', '$BHV', '$tours', '$pasnr', '$pasactivates', '$pastested')");
//show end text
echo "Edit complete!<br />
<form><input type='button' onClick=\"parent.location='users.php'\" value='OK'></form>";
}else{//user didn't press save
?>
<!--Edit form-->
<form action="users.php?new=1&changeme=yes" method="post">
Name:<br>
<input name="name" type="text" value="name" size="79"><br>
<input type="checkbox" name="active" value="1" />Active
<input type="checkbox" name="BHV" value="1" />BHV
<input type="checkbox" name="pasactivated" value="1" />Pas activated
<input type="checkbox" name="pastested" value="1" />Pas Tested <br>
E-mail: <br>
<input name="email" type="text" value="email" size="79"><br>
Training Dates: <br>
<input name="training" type="text" value="training" size="79"><br>
Trial Dates: <br>
<input name="trials" type="text" value="trials" size="79"><br>
# Tours: <br>
<input name="tours" type="text" value="tours" size="79"><br>
Pas Nummer: <br>
<input name="pasnr" type="text" value="pasnr" size="79"><br>
<input type="submit" name="Submit" value="Create">
<input type='button' onClick="parent.location='users.php'" value='Back to list'>
</form>
<?
}}