Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8053223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:46:38+00:00 2026-06-05T07:46:38+00:00

I have a MySql database linked to my website, that has a table with

  • 0

I have a MySql database linked to my website, that has a table with a task list (columns are separated by “/” below), i.e.:

task1 / doTask1.sh / todo

task2 / doTask2.sh / done

task3 / doTask3.sh / todo

task4 / doTask4.sh / todo

etc…

On every request to my website, I want the “todo” tasks to be executed and then marked as “done” by the server. The task can only be executed once. But here comes the problem.

What if:

User A selects the tasks that are marked as “todo”.
doTask1.sh executes and is marked as done, triggered by request from user A.
User B selects the tasks that are marked as “todo” (task3 and task3 only, since task1 is done).
doTask3.sh executes and is marked as done, triggered by request from user A.
doTask3.sh executes again, triggered by request from user B.
Same for doTask4.sh.

Can this happen using PHP/Nginx/MySql, due to simultaneous DB connections? If yes, how can this problem be bypassed/avoided?


In this example, I used doTaskx.sh to simplify the situation. In reality, this column would contain a description of the task and the PHP script powering my website would execute a task depending on that description.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:46:39+00:00Added an answer on June 5, 2026 at 7:46 am

    Yes, this can happen.

    One approach for solving this problem is to do the following:

    • Create a “pending” status”.
    • When a request comes in to execute a task, run an update on the database setting everything matching the ID and status = “todo” to “pending”.
    • If the number of records updated is 1, execute the task and mark it as “done”.
    • If the number of records updated is 0, it means another request got there first.
    • Either way, update the user interface to show that the task is pending/done.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an interesting problem here. I have a MySql database table that has
I have a linked table in ms-access that pulls data from a mysql database.
In a MySQL database I have two tables linked in a join. One table
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I have a mySQL database that tracks our projects and drives our website's display
I have a mysql database table that will store locations for buildings and events
I am using MySql Database, I have a task that is, Any item should
I have a table linked to my mySQL database. I have a particular field
I have a MySQL database that currently uses MyISAM but I am thinking of
I have a MySQL database with a table containing a BINARY(16) column. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.