I have a friend arguing this is a race condition, but I'm struggling to understand how.This is for a web application using PHP and MySQL where users can login and create tickets, these tickets have tasks which users can add. Each task has a time spend variable.When the user submits a task, it adds a row with the task data to a table. After the entry has been added, it calculates the total time spent for all tasks for this particular ticket, and updates a field in a different table with that value.The argument my friend puts forth is that with many users, there will be race condition issues as users are simultaneously adding tasks for tickets.But my defence is that as long as the update for total time spent is run after the insert query, it will still update the field correctly regardless of how many users are adding tasks at the same time.
Is this a race condition?
php;mysql