<html>
<body>

<?php

$password = $_POST['PWD'];

$con=mysqli_connect("localhost","scosen_wgsiw",$password,"scosen_wgsiw");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$ID = $_POST['ID'];
$SEASON = $_POST['SEASON'];
$TYPE = $_POST['TYPE'];
$HOME = $_POST['HOME'];
$AWAY = $_POST['AWAY'];
$STIME = $_POST['STIME'];
$RATING = $_POST['RATING'];
$STATUS = $_POST['STATUS'];

$result = mysqli_query($con, "SELECT ID FROM hockey WHERE ID='" . $ID . "'");
$rowcount=mysqli_num_rows($result);

if($rowcount==0)
{
  mysqli_query($con,"INSERT INTO hockey (ID, Season, Type, Home, Away, STime, Rating, Status)
  VALUES ('" . $ID . "', " . $SEASON . ", '" . $TYPE . "', '" . $HOME . "', '" . $AWAY . "', '" . $STIME . "', " . $RATING . ", " . $STATUS . ")");
}

mysqli_close($con);
?>

</body>
</html>