Im trying to know the time and date everytime a new entry is saved in my database. So i set the column as follows:
The problem is that im just geting 0000-00-00 00:00:00 as the date/time:
The code that im using to update the database is:
<?php
$lat = $_GET['lat'];
$lon = $_GET['lon'];
$fecha = $_GET['fecha'];
// Make a MySQL Connection
$db_database = "xxx";
$db_hostname = "xxx";
$db_username = "xxx";
$db_password = "xxx";
$enlace = mysql_connect($db_hostname, $db_username, $db_password);
if (!$enlace) {
die('No pudo conectarse: ' . mysql_error());
}
echo 'Conectado satisfactoriamente. <br>';
// mysql_close($enlace);
mysql_select_db('xxxxx') or die(mysql_error());
$q = "INSERT INTO `posicion` (`Hora`, `Latitud`, `Longitud`) VALUES
('$fecha', '$lat','$lon')";
//Run Query
$result = mysql_query($q) or die(mysql_error());
echo "Tamos redi";
?>
What can it be ?
Thanks a lot.