PHP表单向MySQL数据库提交重复的条目

I have a database that has data written to it by 3 different forms. The good news is that the forms do write to the database. The bad news is that every time I hit the submit button on one of the forms, a duplicate entry gets created along with the first one.

The forms are online at http://digitaldemo.net/kickass/test.php It is not hooked up to a live database, but I wanted to get it online so that you can see the code.

Here is the add_player.php code that writes the form data to the database:

<?php

// contact to database
$connect = mysql_connect("localhost", "dariia", "celtic03") or die ("Error , check your server connection.");
mysql_select_db("football");

// Set up form variables //

//Get data in local variable
$Player=$_POST['Player'];
$Position=$_POST['Position'];
$Team=$_POST['Team'];

// check for null values
$query="INSERT INTO ff_projections(Player, Position, Team) VALUES('$Player','$Position','$Team')";
mysql_query($query)  or die(mysql_error());
echo "1 record has been entered.";

mysql_query($query) or die('Error, query failed');

?>

You execute the query twice!!

mysql_query($query)  or die(mysql_error());

mysql_query($query) or die('Error, query failed');