Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

v4.1.7 ... timestamp field not updating when record modified

Status
Not open for further replies.

PulsaMatt

IS-IT--Management
Apr 25, 2002
151
US
I have a couple different tables ... all of which I am trying to use a timestamp field to track when records were changed. The problem is that when the records are updated the timestamps are all showing up as all zeros.

The timestamps are all set to "not null" and i have tried multiple defaults (CURRENT_TIMESTAMP, now(), time(), etc) with no success.

This is happening on 4 different tables in 2 different databases (all on the same server tho).

Anyone have any ideas?

Thanks :)


Matt Laski
Network Administrator
Pulsafeeder SPO
 
did you create table like this?
CREATE TABLE t (
ts1 TIMESTAMP DEFAULT 0,
ts2 TIMESTAMP DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP);
 
Here is the code that was used when creating the table:

Code:
CREATE TABLE `parts_inv` (
  `item_number` varchar(25) NOT NULL default '',
  `location` varchar(12) default NULL,
  `available` int(5) unsigned default NULL,
  `as_of` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
)

When importing the first 3 fields from a CSV (item_number, location, available) using mysqlimport the 4th field (as_of) does not update, it comes through as all 0000's.

Matt Laski
Network Administrator
Pulsafeeder SPO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top