I wrote some data into a dbt as follows
date_default_timezone_set("Europe/London");
$dt = new DateTime();
$result = $dt->format('Y-m-d/%/H:i:s');
$query = "INSERT INTO hitcount VALUES(NULL, '$result', 25, 26, 27, 28 )";
$result = $conn->query($query);
if (!$result) die ("Database access failed: " . $conn->error);
// If this repeated section is omitted $result is set to 1 in the dbt after the first insert. I don't know why at 20 Jan 17
date_default_timezone_set("Europe/London");
$dt = new DateTime();
$result = $dt->format('Y-m-d/%/H:i:s');
// end of repeated section
$query = "INSERT INTO hitcount VALUES(NULL, '$result', 16, 17, 18, 19 )";
$result = $conn->query($query);
if (!$result) die ("Database access failed: " . $conn->error);
I cannot understand why I need to "re-calculate" $result after the first INSERT.
Could someone explain this to me, please ?