Jump to content

I want to create a log file on insert, update, delete.


HungryMind

Recommended Posts

Thanks For The Link & Info Friend.It's Seems Like Complicated For Me :SBecause I'm Not Professional.So Can We Set Action On Insert, Delete, Update Events Using Triggers?I Just Want To Create a Log Entry Every time On These Events.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks For Your Replies Once Again, I've Created My First TRIGGER :) I'm So Happy, Thank a lot Friends.I've Now One More Question

DROP TRIGGER IF EXISTS `catch_insert`//CREATE TRIGGER `catch_insert` BEFORE INSERT ON `books` FOR EACH ROW BEGININSERT INTO testing.trigger (id, email, password) values ('1', 'abc@abc.com', 'pass');END//

This Is Working Perfect On Every Time When Ever New Record INSERTS.I Just Want To Create a Log File Using Trigger To Do Same Thing.I Don't Want To Create Records On Database.So Please Guide.

Link to comment
Share on other sites

Database records are log entries. If you want to save the query to a text file then use the regular MySQL query log, not a trigger. All queries already get saved to the general query log. You can use that log if you're looking for past queries.

Link to comment
Share on other sites

I don't know if I understand your question. Read the link I posted above to the description about the query log. You may not have access to the log on a shared host, you'll want to ask your host and see if they can set up a log just for your account.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...