Reputation: 11 Tradesman
- Active Members
- Active Posts:
- 763 (0.72 per day)
- 31-August 11
- Profile Views:
- Last Active:
- Jul 15 2014 07:43 PM
- Dream Kudos:
Posts I've Made
On the server-side you might investigate UPDATE TRIGGERs, together with log-tables - to write the username, date/time, field-name, old-value, new-value. (UPDATE triggers may or may not be helpful in this process.)
If you are trying to note every change to the database then this will quickly escalate into a v.large task. It is best to concentrate on a handful of significant fields if possible.
Complicated yes I fully agree with you friend lol. I'm actually someone that can be good at thinking of complicated algorithms like this because I fear in this case friend Triggers won't work. I believe triggers only work for things IN the MYSQL database. I suppose you could update columns somehow called has_change_xyz as you suggested but this seems sloppy as usually triggers are intended for other things like summing up data etc. and not for something like this to my knowledge. I have a decent idea in my head and I'd be more than willing to show a solution for email updates via changes like this and maybe you can think of improvements?
In this case the project I'm being required to work will REQUIRE that this be a feature somewhere along the line.
Posted 14 Jul 2014Jon thanks I'm not asking about how to update the user input etc. I already have a form that does this and it works just fine, rather when the user uses the controls to update everything the drop downs for True False etc. change made to EXISTING vales in the table that users can edit need to be recorded.
When these changes are recorded they need to be emailed to a list of emails (admins) about the updates/edits that occurred.
I also know how to email the admins too what I'm asking about the best way to acquire the long string of changes/edits that a user could potentially change and change one a few or all variables for a given item.
So for example: I have a MYSQL table that contains the following columns for houses:
has_ac, has_tub, has_atrium, has_pool, has_closet, additional_comments
For simplicity lets say the has values are boolean and additional comments is just a TEXT column. A user can than change EXISTING values so BOB logs in and there's a Form (again I'm not asking about how to update the values via a form) I know how to do this.
In any case Bob logs in and he wants to change some values on a house (he's doing an edit)
He goes to the Edit listing page and changes some values around he changes has pool from true to false and has_has_tube from false to true. He also adds some comments. He clicks the update button. Now I know how to update this via mysql but what I'm asking is at that point I would like to have an email dispatched to admins that says something along the lines of;
"Attention Admins Bob updated XYZ house values: Has Tub To True, Has Pool To False, And additional_comments were added".
The problem with this idea though is if while Bob is on the same edit page and before he submits that page what if he changes back has_tub to false? You would need to add that to the algorithm so it's removed from the concatenated string since no changes were made. This gets VERY COMPLEX.
Another way to do it is comparing values already in the MYSQL table to values submitted AFTER the form is submitted and creating a string that way. I'm trying to figure out an efficient way of doing this though. Do you have any ideas?
Thanks Friend I hope this helped explain what I want.
Posted 10 Jul 2014thanks ctbweb and artificial soldier. You've answered my question. I know. Session poisoning can pose a real threat but that shouldn't be a problem with my configuration. Also you're right php scripts aren't pages but server code lol I see your point(s). Thank you guys for the help!
Posted 21 Apr 2014Your code is not in <script> tags, so it wouldn't work.
Ok my code is in script tags friend I was just using this up here as a demo to show you generally why this is confusing. Also to the other guy saying you shouldn't use onload most of the time again I know that but that's not my point my point is I don't understand why this wouldn't be working.
Posted 30 Mar 2014I figured this out there was some internal error that I fixed by re-installing eclipse (who knows what was wrong but things are working fine now)
- Member Title:
- D.I.C Addict
- Age Unknown
- Birthday Unknown
- Click here to e-mail me
adn258 hasn't added any friends yet.