looking for help with mysql/php
I’m using query to update table if user plays a quiz again.
The thing is, that I’m now using this query: (KEY is set to email)
ON DUPLICATE KEY UPDATE correct = GREATEST(correct, $correct), time = LEAST(time, $time),
But now I realised that it upgrades time even if the score is not greater.
Any tips to fix this? I want to update time only if score is greater or same.
This should do the trick