I have a table with following attribues, ignore unalignment . Field Type Null Default url varchar(15) No email tinytext No paste longtext No title text No private tinyint(1) No date varchar(35) No language varchar(25) No timestamp timestamp No CURRENT_TIMESTAMP Code (markup): Now i want automatically add CURRENT_TIMESTAMP in the timestamp field on every query but the timestamp is always, 0000-00-00 00:00:00.
Are you passing anything to the timestamp column when you make an insert, 0, '', or even NULL? You need to make sure you are not inserting anything into that column if you want to get CURRENT_TIMESTAMP. That's the only thing I can think of why you are getting 0000-00-00 00:00:00.