jeudi 14 juillet 2016

Triggers or PHP scripts?

So, I am developing a system in PHP + MySQL which has about 4 related tables. Any form of Insert,Update, and Delete in one table typically reflects across at least 2 tables.

My question is, what is more efficient, the use of triggers or additional php script (which triggers SQL queries) to take care of the required related changes?

Triggers seems ideal to me, but when I write them they become pretty complicated and messy from readability point of view. PHP allows for a more "sane" way of doing things.

Please suggest on the basis of both, performance as well as usability/future modifications etc.

Aucun commentaire:

Enregistrer un commentaire