Hi
When running the following code the record gets inserted twice. Can somebody please tell me where I am going wrong. Many Thanks
<?php
$conn = mysqli_connect("localhost","root","XXXXXX","test");
if (mysqli_connect_errno()) {
printf("Connect failed: % s/n", mysqli_connect_error());
exit();
} else{
$gamedate = '2012-1-01';
$sql = "INSERT INTO fixtures (gamedate)
Values('$gamedate')";
$res = mysqli_query($conn,$sql);
if ($res === TRUE) {
echo "The record has been inserted";
} else{
printf("Could not insert the record: %s\n", mysqli_error($conn));
}
}
mysqli_close($conn);