Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2007



Tip: Looking for answers? Try searching our database.

delete log email

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KeithLaw999 - 11 Sep 2007 11:45 GMT
Hi i have a mysql database, and a fairly large crm system, there are some
entries in my database which being deleted somehow, and there are a few
different delete option pages.

is there away of getting an email sent to me when a row is deleted from a
table called enquiries, with the actual page name that delete accured, so i can
find out where this is happening.

so i would get an email with

item deleted from table enquiries

this was deleted from page deleteenquiry.cfm
Azadi - 11 Sep 2007 12:06 GMT
for starters, just put an appropriate cfmail tag right after any delete
cfquery you want to keep an eye on - that will fire off every time the
delete query is executed

as for requesting page name - depends where your delete queries are: if
in cfc's you will probably have to pass in another argument with current
page's name into the cfc and then use it in the cfmail; if they are in
same cfm pages as the link/button to execute deletion, then use
cgi.script_name; if the delete query is in a separate cfm page (i.e.
delete_email.cfm), then try using cgi.http_referer instead (not sure
about this one if the delete is fired through form submission, though,
but will probably work, too...)

as alternative to email, consider using <cflog> tag....

Signature

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

KeithLaw999 - 11 Sep 2007 12:33 GMT
yes but what i am looking for is a global solution, so is there a way of using the application page to send me an email if the delete function is used?
Azadi - 11 Sep 2007 13:04 GMT
i see...

i am afraid there is no easy solution like that, if any at all...

technically, one probably (this is me just hypothesising here...) could
"under the hood" of cfquery tag and write some custom java which extends
it to do what you want.... but i guess this will also bee way too
rdbms-specific to implement on any wider scale...

but then again i may be wrong, and someone smarter than me is meanwhile
typing exactly the code you need...

Signature

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

GArlington - 11 Sep 2007 14:27 GMT
> yes but what i am looking for is a global solution, so is there a way of using the application page to send me an email if the delete function is used?

What you might be able to use is a DB trigger, it is DB specific so
you will have to look it up how to do that depending on you setup.
MEsquivel - 11 Sep 2007 15:43 GMT
What DBMS are you using?

Can you add a trigger to that table, in order to insert information on a log
table on the delete event, and have a CF component read this log and send the
mail to you?

Not really sure if this is what you're looking for ...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.