I am reading the date from android app and send it (As string) to PHP web service to insert the time to MySQL database and save it in string fields but this is not happening.The time format is DD-MM-YYYY like that 25-04-2017, Do I need to convert the date to another format. Here is my PHP code:
<?php
if($_SERVER["REQUEST_METHOD"]=="POST")
{
require "init.php";
creat_Student();
}
function creat_Student()
{
global $con;
$user=$_POST["user_id"];
$car=$_POST["car_id"];
$dating=$_POST["dating"];
;
$query="Insert Into items (user_id,car_id,dating) values ('$user','$car','$dating');";
if(mysqli_query($con,$query))
echo $con->insert_id;
else
echo "Error";
mysqli_close($con);
}
?>