Re: Re: backup of database record before update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Neil Smith [MVP, Digital media]" wrote:
At 09:46 01/11/2007, you wrote:
Message-ID: <44.D0.03551.E40A9274@xxxxxxxxxxxx>
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.

And still you would have to rely on one more infrastructure.
Just do it the way you like, and I´ll do it my way... ;-)

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux