Welcome Guest, Not a member yet? Register   Sign In
Poll: Straight PHP or SQL Trigger
You do not have permission to vote in this poll.
PHP All the way!
80.00%
4 80.00%
SQL Triggers
20.00%
1 20.00%
Total 5 vote(s) 100%
* You voted for this item. [Show Results]

Database - Triggers or no Triggers?
#2

I usually handle this in the model through PHP. The only real reasons I can think of for this preference are:
- I don't have to rewrite the triggers if I change databases (not a likely occurrence for me, but it was one of the reasons)
- I can code the behavior once in my base model (or, in this case, most of the code was written by someone else) and control whether it's used on a particular model with a boolean value, rather than defining a new set of triggers for each table.

I'm sure if I really put my mind to it I could find a way to easily define the triggers in any supported database, but I really didn't give the option much thought when I made the decision (I really didn't even give it enough consideration to think of it as a conscious choice).
Reply


Messages In This Thread
Database - Triggers or no Triggers? - by jLinux - 08-27-2015, 10:55 AM
RE: Database - Triggers or no Triggers? - by mwhitney - 08-27-2015, 12:11 PM
RE: Database - Triggers or no Triggers? - by Narf - 09-01-2015, 02:16 AM
RE: Database - Triggers or no Triggers? - by Narf - 09-01-2015, 05:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB