PDA

View Full Version : MySQL and Triggers


Fumigator
05-04-2007, 12:29 AM
I understand any version below 5.0.2 does not support triggers (from the MySQL manual).

My host will upgrade to 5.+ eventually... until then I was just wondering if anyone had a clever way of logging table changes? My trigger (if I could create it) would write to a log table (old and new values) any time a table was updated, deleted or inserted. Is my only option to do this manually?

Velox Letum
05-07-2007, 06:50 PM
Yes, your only recourse is to do this manually, at least as far as I know before MySQL 5. It's not too difficult though if you use a database class and you put in some logic to log changes upon UPDATE or INSERT.