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!

conditional trigger

Status
Not open for further replies.

richardko

Programmer
Jun 20, 2006
127
US
Hi,
i have a field called "status" in a mysql table containing orders.
This field records the status of an order. is it possible to create a condition (a trigger of some kind) for this field such that whenever its value changes it records this change to another field.
thanks
ro
 
i am updating the status value through php.
thanks
 
i forgot to mention but there are other clients from connecting to the database and updating it also.

For example, we have a shipping system where the carrier updates the "status".

i could use a php to periodically check the status but i am looking for alternatives.
thanks
 
If all the transactions are performed using the same script, I would suggest a sub routine which updates the other field each time the 'status' field is altered.
If you are using seperate scripts you may have to call an update script to perform the task.
What is the function of the other field, a last updated date field?

Keith
 
thanks for the reply.
I will probably have to use trigger because there are scripts which connect separately to the table using ODBC. I dont have control over them.
Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top