1

I use PHP to update the particular row.. I have a column called "last updated" which I created via phpmyadmin, like this

 type => "datetime", default => current time stamp, on update =>current timestamp

"last updated" column's time gets updated when PHP actually changes any value in the row, but sometimes PHP updates the row but the values are same, in that case, last_update column remain same, I want to change its time even no value get changed

is there any option available in phpmyadmin or i have to update "last updated" column via php code

nikhil123
  • 48
  • 1
  • 10
  • 1
    You could always not have it auto-update and update it manually in the update operations. MySQL seems to be using a post-update trigger but no changes means that a row is not updated so it doesn't count as an update. You can confirm this by looking at the "affected rows" value after the update. – apokryfos Nov 30 '17 at 14:27
  • Also related https://stackoverflow.com/questions/8657189/update-mysql-table-with-same-values-and-still-get-a-timestamp-update – apokryfos Nov 30 '17 at 14:28

1 Answers1

1

Try this

type => "datetime", default => NULL, on update =>current timestamp
Rain
  • 3,416
  • 3
  • 24
  • 40