At 09:46 01/11/2007, you wrote:
Message-ID: <[EMAIL PROTECTED]>
Date: Thu, 1 Nov 2007 10:45:57 +0100

"Leo G. Divinagracia III" wrote:

Stephen Sunderlin wrote:
Neil,

Have you had success with triggers.  I couldn't get one to work and
then saw discussion ...
...snip...
... on a 5.0.20nt box.

one thing i read recently is triggers and stored procedures do use
more system resources though...

Why depend on different MySql infrastructures, while you can easily implement a perfect fit for your needs in a PHP routine?


Because it's the job of the database to implement data access, referential integrity and storage. It's the job of the PHP code to manage business and application logic, and some data sanitisation. Finally, it's the job of the templating engine / output layer to manage actual display of content.

I tend to try to move as much as possible to the Database, because it's often running on a separate machine or cluster.

That frees up resources on the web servers to get and send data as quickly as possible, rather than have it spending all day constructing SQL strings and managing stuff the great engineers at MySQL have already invented to make my life simpler ;-)

TBH it *oughtta* be much faster than having PHP do that, since (a) you're saving the roundtrip of the query to the DB from the web server and (b) the trigger query will probably end up quite rapidly in MySQL query cache on the DB in most cases.

Cheers - Neil

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to