I need to update (replace) fields in a MySQL database, but only if they have changed.
The table contains an ID, text field and date changed. Users query the data by ID based on the date it was changed. i.e. If the date is before the last the time user queried the data, he doesn't want it.
I would like to change the date in the database only if the text field is different from the existing text field with the same id.
I could query the data, compare the result and only post back if the new data is different, but this is a lot of overhead and the database connection is rather slow, so I am looking for a way to do this in a single query.
Thank you.