Hello!
I want to create a system to track when a record is created and modified. I have created all of the fields needed and made them read only so they can't be changed, I just can't seem to figure out the rest.
I'm using a ON UPDATE CURRENT_TIMESTAMP
attribute for lastmodified
, however I still need some way to handle the other three options.
I need to pass $_SESSION["username"]
to the field createdby
and the current time to createdat
when a new entry is submitted.
I also need to pass $_SESSION["username"]
to the field modifiedby
whenever a change is made to a field.
Any suggestions on how this can be done easily?