title: Error when trying to insert date into datetime column
body: <p>I have a form that is trying to insert some data into an SQL Server 2008 database. The form has a function to get the current date/time and then insert it into the database as follows;</p>
  
  <pre><code>$now = date("Y-m-d H:i:s");
  $q = "INSERT INTO ".TBL_USERS." ( username, password, userid, userlevel, email, created, updated, timestamp, fullname, avatar )
  VALUES ( '$username', '$password', '0', $ulevel, '$email', '$now', '$now', $time, '$fullname', $avatar)";
  </code></pre>
  
  <p>However, when the form submits it reports an error of;</p>
  
  <p>Warning: mssql_query() [function.mssql-query]: message: Cannot insert the value NULL into column 'created', table 'dbo.users'; column does not allow nulls. INSERT fails.</p>
  
  <p>We have done an echo $q to show the data trying to be inserted and it does show the correct datetime (e.g. 2009-10-28 15:43:00.000), the .000 gets added by the db normally.</p>
  
  <p>If I manually create a record in the database, the datetime in the example above is accepted.</p>
  
  <p>Wondered if anyone had come across this issue before?</p>
  
  <p>Thank you.
  Neil</p>