problem in create table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

problem in create table

Post by itsmani1 »

hi there....

Code: Select all

CREATE TABLE t
(
  ts1 TIMESTAMP NULL DEFAULT NULL,
  ts2 TIMESTAMP NULL DEFAULT 0,
  ts3 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
);
see the above coad ...
what i want to do is : just to create a table where on evey insertion or updation it just maintain its current date and time? my question is that on whic version of mysql above query will work and my 2nd question is : is above code corrent and will it work?

Regards...
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Chenge to datetime.

Code: Select all

CREATE TABLE `t` (
  `ts1` datetime default NULL,
  `ts2` datetime default NULL,
  `ts3` datetime default NULL
) TYPE=MyISAM;
Post Reply