Welcome Guest, Not a member yet? Register   Sign In
mysql affected column in mysql trigger
#1

[eluser]Skuja[/eluser]
Has anyone been dealing with MySQL triggers ?
I have a problem. I am creating a trigger for a table so that on updating a field value, all the other fields will be updated... I can't figure out how to check which in which column field is affected while on table update.
Hope someone could help me with this one.
#2

[eluser]davidbehler[/eluser]
Have you looked here?

I don't think there is a function that tells you wether a field has changed or not, but you should be able to compare the new and the old value:
Code:
if(NEW.column == OLD.column)
  //do something
or something similar...I'v not yet worked with triggers




Theme © iAndrew 2016 - Forum software by © MyBB