title: Inserting time into database
body: <p>The below piece of code isn't working the way it is supposed to</p>
  
  <pre><code>$t = date('Y-d-m H:i:s',time());
  $query = "INSERT INTO time VALUES('$t')";
  if(mysql_query($query))
  echo "Date and Time are added";
  </code></pre>
  
  <p>I have created a table named <code>time</code> with only one column <code>now</code> and <code>DATETIME</code> as <em>datatype</em>. Even though the <strong>PHP</strong> script executes successfully in the browser by printing <code>"Date and Time are added"</code>. 
  <br><Br>The database isn't updating the way it is supposed to be. Rather than the <em>current time</em>, it gets initialized to default value. 
  <br><Br>Do suggest the way to rectify the problem.</p>