This topic is locked

Change conditional field

4/15/2011 10:53:59 AM
PHPRunner General questions
S
sandrotab author

Hello everyone,

with PHP you wonder if you can bring in a field the timestamp and the user name only if the field has been changed.
Example:

In a table I have 9 fields.
Field1

Field2

Field3
Data1

Data2

Data3
User1

User2

User3
When I edit in the record, if you change only the Field2, I would write the value of the timestamp in Data2 and write in the user User3 course without changing other fields.
To do this, set the date fields as the default Now () while the user fields $ _SESSION ["UserID"] but my problem is that when I save the record, the default values ​​are displayed on all date fields and User, Instead I would put only one condition for the field changed, even in "JavaScript ".
Can you suggest a sample code?