title: conversion of datetime datatype to date and time datatype in php/mysql
body: <p>I am a newbie. I started php coding few days back. I want to copy a "datetime" datatype in php to fields that are of "date" and "time" datatype. </p>
  
  <p>I have kept the field name datetime_info for the datetime value. It exists in try1 table. date is the name of field for "date" datatype and time is the name for "time" datatype. These two exist in try2 table.</p>
  
  <p>Here is what I have written. </p>
  
  <pre><code>$result = mysql_query("SELECT * FROM try1");
  
  while ($row = mysql_fetch_array($result))
  {
  
      $result_update = mysql_query("INSERT INTO try2 (date, time) VALUES ('".$row_team['datetime_info']."', '".$row_team['datetime_info']."')");
      if (!$result_update)
      die('Error: ' . mysql_errno() . mysql_error());
  }
  </code></pre>
  
  <p>The values stored in "try1" table are:</p>
  
  <pre><code>id  datetime_info
  1   2008-10-02 00:00:00
  2   2008-10-09 00:00:00
  </code></pre>
  
  <p>The expected response should be the date and time stored in respective fields. However, the output is </p>
  
  <pre><code>id  date        time
  2   0000-00-00  00:00:00
  3   0000-00-00  00:00:00
  </code></pre>
  
  <p>Can anyone explain me why and how? I tried a lot of sites but did not find any proper explanation for this. Thank you in anticipation. </p>
  
  <p>Regards,
  BasicGem</p>