I am trying to add parameter in query which passes indian time zone to mysql database server.But when i am passing this query it shows 0000-00-00 00:00:00
in my table.
I am using hostinger php my admin database server.
Please help me to solve this.
<?php
include 'confi.php';
date_default_timezone_set('Indian/Maldives');
$email = isset($_POST['email']) ? mysqli_real_escape_string($conn,$_POST['email']) : "";
$today = date("d/m/Y h:i:s A");
$sql ="INSERT INTO `i_order` (`ID`, `email`,`date`) VALUES (NULL, '$email', '$today');";
$qur = mysqli_query($conn,$sql);
if($qur){
$json = array("status" => 1, "msg" => "success!");
}else{
$json = array("status" => 0, "msg" => "error!");
}
@mysqli_close($conn);
/* Output header */
header('Content-type: application/json');
echo json_encode($json);
?>