I am trying ti insert some temperature number from my sensors in my sensor table, and I want to have a time stamp when those temp. numbers are stored in my table... what time and date.
My auto time stamp in my database is -8 hours from my local time Europe/Skopje
because I don't know how to change it in my database I'm trying to put my time stamp.. the type of my field is 0000-00-00 00:00:00
Here is my PHP code:
<?php
// Connect to MySQL
include("dbconnect.php");
date_default_timezone_set('Europe/Skopje');
$Data=date("Y-m-d H:i:s");
// Prepare the SQL statement
$SQL = "INSERT INTO tanjaarduino.sensors (Data, sensor1 ,sensor2, sensor3, sensor4, sensor5, sensor6 ,sensor7, sensor8, sensor9, sensor10, sensor11, sensor12) VALUES (Data=".$Data.", '".$_GET["s1"]."', '".$_GET["s2"]."','".$_GET["s3"]."','".$_GET["s4"]."','".$_GET["s5"]."','".$_GET["s6"]."','".$_GET["s7"]."','".$_GET["s8"]."','".$_GET["s9"]."','".$_GET["s10"]."','".$_GET["s11"]."','".$_GET["s12"]."')";
echo "The time is " . $Data;
// Execute SQL statement
mysql_query($SQL);
?>
thanks