I am getting an unwanted duplicate entry for every last row on an insert statement. Does anyone know why this happens and how I can fix it?
?php
if(isset($_POST['submit'])) {
$con = mysql_connect("localhost"," "," ");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
$sql="INSERT INTO table(ID,user) VALUE('$ID','$_POST[user]')";
$result = mysql_query( $sql,$con );
if (!mysql_query($sql,$con)) {
die('Error: ' . mysql_error());
}
header( 'Location: index.php?success' ) ;
}
?>