I'm learning to use mysql so i created a really simple project manager program. i wanted to track if a user saw her/his tasks in a project. So i want to update user_seen_task filed when a project is got queried by a user, but obviously i only want to update this field if it isn't already set.
This is my approach what i have already:
UPDATE task
SET user_seen_task = 1, user_seen_task_date = NOW()
WHERE project_id = 14 AND user = 4 AND user_seen_job != 1
Unfortunately this query will update user_seen_task_date every time it runs.
Any help is greatly appreciated.