RE: Tracking what has been changed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----Original Message-----
From: Robb Kerr [mailto:rkerr.news@xxxxxxxxxxxxxxxxx] 
Sent: 05 May 2005 00:29
To: php-general@xxxxxxxxxxxxx
Subject:  Tracking what has been changed


Here's the scenario...

I am building a site in which users will be able to create and then
later edit personal information. When they edit their information, I
need to keep track of what was changed so that I can inform via email a
person to approve the changes. Here's the flow I'm considering...

When an UPDATE page is loaded, I build an array like...

$fields = array("table.field1" => value, "table.field2" => value,
"table.field3" => value)

I then plan to save this array to a SESSION variable. Then, when the
form is posted I save the new form contents to another SESSION variable.
Then I compare the two arrays and save the names of the fields changed
to an array saved in a third SESSION variable. Finally, when I build the
email, I can parse the changed fields array to inform the person who
must approve the changes.

First, does anyone have a suggestion of a better way to do this? 
--------------------------
How long do you expect people to take to approve the changes? What
happens if they don't approve them? What if they are on holiday? What if
someone changes the data, then someone else makes another change, then
the person who approves them approves the first change?

I would recommend storing the change information in a db. 
Say you have a table t_personal_info

Id
firstName
surName
Telephonenumber
dateUpdated

You can then have another table 
t_personal_info_pending
With an additional field changeid (to handle multiple changes to the
same record)

With the same fields. When someone approves a change, update
t_personal_info with the change and delete the record from
t_personal_info_pending

----------------------------
Second, I can't seem to save an array to a SESSION variable. I build the
array in a local variable and then set the SESSION variable equal to it.
When I recall the SESSION varialbe, it's contents is "Array". Then, when
I print_r() the SESSION variable, I still get "Array" as the contents.
What's up?

Thanx in advance for any help.
-- 
Robb Kerr
Digital IGUANA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY

**********************************************************************

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from http://www.gammaglobal.com

E&OE

**********************************************************************
**********************************************************************

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux