Amir  Mohtat
Amir Mohtat

Reputation: 21

Server MySQL automatically sets attribute "on update CURRENT_TIMESTAMP"

My Data Base has 2 Timestamp Columns, One for the Created on and one for the Last Update, When I create the data base using PHP and then check the table later in PHPMyadmin the first Timestamp column(createdon) has a DEFAULT value set to CURRENT_TIMESTAMP and also has an "attribute" that says "on update CURRENT_TIMESTAMP". I make these tables pragmatically so I can't go and change each one. I know I can set the DEFAULT to zero using SQL code, But How can I remove any potential "attributes" or "triggers" ?

Upvotes: 1

Views: 110

Answers (1)

Amir  Mohtat
Amir Mohtat

Reputation: 21

I fixed the problem with simply putting "DEFAULT 0" in front of the first column.

Upvotes: 1

Related Questions