title: Inserting Date data to Mysql table using PHP
body: <p>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:</p>
  
  <pre><code>&lt;?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-&gt;insert_id;
      else
        echo "Error";   
       mysqli_close($con);
  }
  ?&gt; 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Rr6KJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rr6KJ.png" alt="enter image description here"></a></p>