List:General Discussion« Previous MessageNext Message »
From:Trevor Sather Date:June 9 2003 11:23pm
Subject:Default Datetime?
View as plain text  
Hello

I have a table for messages, and when a new message is inserted I want the
current date and time to be inserted into the MessageDated and MessageTimed
fields.  I'm using MySQL 3.23.56 (?), with Chilisoft ASP, and using the
MySQL Control Center interface.

The problem is that no matter what I try, I seem to end up with
00000000000000 in the fields instead of the current date and time.  For
example, I have two hidden fields in my insert form, called MessageDated and
MessageTimed, each set to <% = now() %>.  I have the fields in the database
set to DATETIME and also with default value 'now()'.  But this doesn't seem
to work.

How can I get the default value to be now()?  The only way I've succeeded is
by setting the type of field to VARCHAR, but that's not ideal.

Thanks in advance for any help you can give me!

Best wishes

Trevor


Thread
Default Datetime?Trevor Sather10 Jun
  • Re: Default Datetime?Gabriel Guzman10 Jun
  • Re: Default Datetime?Becoming Digital10 Jun
  • Re: Default Datetime?Paul DuBois10 Jun