If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Not saving current timestamp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-21-10, 12:22
xionhack xionhack is offline
Registered User
 
Join Date: Apr 2010
Posts: 7
Not saving current timestamp

Hello. I have a table and one of the field is set as timestamp and for default it has the current timestamp and is set as not null but when i save it, it doesnt put the current timestamp but puts "NULL", anybody has any idea why?

--Table: tickets

--DROP TABLE IF EXISTS tickets;

CREATE TABLE tickets (
ticket_id int AUTO_INCREMENT NOT NULL,
ip_address varchar(20),
host_name varchar(120),
operating_system varchar(200),
contactname varchar(200),
`subject` varchar(200),
category varchar(45),
priority varchar(20),
ticket_status int NOT NULL,
assigned_to varchar(30),
real_priority varchar(20),
extension varchar(10),
ticket_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
/* Keys */
PRIMARY KEY (ticket_id)
) ENGINE = InnoDB;

CREATE UNIQUE INDEX ticket_id_UNIQUE
ON tickets
(ticket_id);
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On