Hello.

   Have you checked if the timestamp column is set with CURRENT_TIMESTAMP as 
the default value?
   If it doesnt, you can try this:

   ALTER TABLE tbl MODIFY column TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP;

   And mysql will fill the column with current timestamp when a new row is 
appended or when a old
one is updated.

   It seems that MySQL timestamp have changed a lot in 4.1 version.

Good luck!


Richard AB


----- Original Message ----- From: <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Sunday, December 18, 2005 5:03 PM
Subject: timestamp


hi!
I'm using mysql 4.1 and I have a problem with a TIMESTAMP column (with all of 
them actually). I've
used them before in mysql 3.x and they worked just fine. And at first I thought 
'they changed
something', but in the mysql 4.1 manual it still says

"A TIMESTAMP column is useful for recording the date and time of an INSERT or 
UPDATE operation.
The first TIMESTAMP column in a table is automatically set to the date and time 
of the most recent
operation if you do not assign it a value yourself. You can also set any 
TIMESTAMP column to the
current date and time by assigning it a NULL value."

But when I try to insert a row into a simple table like this "insert into test 
set
txt='something'", the field "data", which is of type TIMESTAMP, doesn't 
initiate with the current
date, but turns out to be '0000-00-00 00:00:00'. I've also tried with update, 
and with other
tables too. The same thing.

Could anyone please help?
Thanks.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/204 - Release Date: 15/12/2005





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/204 - Release Date: 15/12/2005


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to