Finaly managed to get insert to work but now I cant get the date to insert correctly into the DB all the columns in the DB are text Ive tried changing the column names
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
} else{
echo "Connected";
echo "<br>";
}
$Table = mysqli_query($DB, "SELECT * FROM TBL_TimeDate");
while($Row = mysqli_fetch_array($Table)){
echo "Date: " . $Row['DMY'] . " | Time: " . $Row['Time'];
echo "<BR>";
}
$Row = mysqli_fetch_array($Table);
$DMY = date("d-m-Y");
$Time = time();
echo "Date: " . $DMY . " | Time: " . $Time;
if(!mysqli_query($DB, "INSERT INTO TBL_TimeDate (DMY, Time)
VALUES ($DMY, $Time)"))
{
echo("Error description: " . mysqli_error($DB));
}
?>
output looks like:
Date: -2017 | Time: 1412681153
Date: -2017 | Time: 1412681230
Date: -2017 | Time: 1412681231
Date: 07-10-2014 | Time: 1412681709