I have tried to create a MySQL table with the following lines:

$query[] = "CREATE TABLE member (
ID        bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
userName             varchar(40) NOT NULL,
.
.
.

RecordCreationTime   TIMESTAMP NOT NULL DEFAULT '0',
LastLogin            TIMESTAMP NOT NULL DEFAULT 'now()',
RecordTouchTime      TIMESTAMP NOT NULL DEFAULT 'now()',
)";

No matter what I set the defualt values to, I get the timestamp value in the
first timestamp field and zeros in all after the first one.

The above give the following result:
RecordCreationTime: 20020224233339
LastLogin: 00000000000000
RecordTouchTime: 00000000000000

I had to currently use a separate insert statement after the table creation
and it works fine... but the default doesn't seem to work with timestamp...
yet no matter what I do, I always get the current timestamp if I don't
update the first timestamp field.

$query[] = "CREATE TABLE member (
ID        bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
userName             varchar(40) NOT NULL,
.
.
.

RecordCreationTime   TIMESTAMP,
LastLogin            TIMESTAMP,
RecordTouchTime      TIMESTAMP,
)";

This STILL update the first TIMESTAMP field as a defualt when updating
another column... but only the first TIMESTAMP field.
I've had to put a dummy field as TIMESTAMP as the first one... the rest are
fine.




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to