I agree, don't use triggers unless:1. you can't access anything but the db, as in a closed source or very complex application / system. 2. need behavior that is very tightly coupled to db changes, such as logging into the db of db actions itself.
On 6/17/2011 5:36 AM, black ares wrote:
sure, when you do the insert or update, keep track of that fields too.How ever triggers are not a good design, they are the cause in 80% of unvanted behaviors bugs in apps.----- Original Message ----- From: "Alex Hall" <mehgcap@xxxxxxxxx> To: "programmingblind" <programmingblind@xxxxxxxxxxxxx> Sent: Friday, June 17, 2011 4:51 AM Subject: alternative to triggers for mysql?Hi all, I have just found out that bluehost.com does not support triggers since one needs superuser privileges for that. Two of the tables I use keep records, and I was using triggers to track the date and time that a given record was first created and then updated. An article, for instance, might be created on June 1, 2010 at 1422, then updated a month later, then updated again in September. The trigger would have stored the date created and the date in September of the most recent update. Is there a way to do this without using triggers? -- Have a great day, Alex (msg sent from GMail website) mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind__________View the list's information and change your settings at //www.freelists.org/list/programmingblind
-- Kerneels Roos Cell: +27 (0)82 309 1998 Skype: cornelis.roos __________View the list's information and change your settings at //www.freelists.org/list/programmingblind