If we have a class which loads a row from the database and can update it etc,
+-------------------------------+ | id car colour price fuel | +-------------------------------+ | 2 bmw blue 22000 petrol | +-------------------------------+
If within this class, We run a update to change colour from blue to green, We can maintain this green setting without needing to requery the database, as we can change our internal value of $colour within our class to reflect the change.
However, lets say another php script simultaneously does some work on this table, and it changes price from 22000, to 20000
In our other object, we think we have up to date variables, But unknowingly to us we do not.
We can requery the table with ID each time to change all internal variables, But this isnt efficient.
Is it possible to link all changes to a central object, and if another script access or updates etc, they do it within this object, that way the change will be reconised anywhere.
Thanks in advance.