Im trying to save the time of a query in my database using the CURRENT_TIMESTAMP. The problem is that the timezone is not correct and when i talked to the people from HostGator support they gave me this answer:
Thomas after researching this issue, I found that you can only change it on the site, to change it on phpmyadmin you would need root access which you do not posses on a shared server.
The server has 2 hours difference from my home country (Chile). Does someone know what can i do? Im using this code to update the database:
<?php
$lat = $_GET['lat'];
$lon = $_GET['lon'];
// 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
(NULL, '$lat','$lon')";
//Run Query
$result = mysql_query($q) or die(mysql_error());
echo "Tamos redi";
?>
And the configuration of the 'Hora' column is:
Does anybody think of a way to solve this?
¡Thanks!