Jump to content

Recommended Posts

I have a mysql table in which will be updated fairly frequently via php code on a form.

My question is how do I code a log of the changes made into another table using php or calling a stored procedure from within the database. or if you can think of a better way suggest it.  Stored procedure would be more secure if possible.

Link to comment
https://forums.phpfreaks.com/topic/254707-logs/
Share on other sites

Hi

For explanation purposes lets say i have a table with the field age.  if i have an update query in php that gives the ability to change that age i want a bit of code to intercept what the change was and place it in a table or any sort of format where it is clear to understand

 

Sorry for the confusion hope this is clearer :D

Link to comment
https://forums.phpfreaks.com/topic/254707-logs/#findComment-1306058
Share on other sites

Rough idea (I use it on my personal family site. It can be used to notify family members of changes to the site; ie new pics, new relatives, posts to the message section etc)...

 

1, create a table called ummmm table_actions

2. id, table_name, what_action_what_date

3. Essentially any table has 4 basic actions - add, delete, edit and view

4. write a small function that you include in every script that does one of the things in #3

5. the function (A) sets the table effected, the date and the action; then (B) adds that to the table_actions

Link to comment
https://forums.phpfreaks.com/topic/254707-logs/#findComment-1306092
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.