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 6906215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:16:52+00:00 2026-05-27T08:16:52+00:00

Say I have a website, with 2 users on the site. Both load a

  • 0

Say I have a website, with 2 users on the site.

Both load a php page which inserts 1000 big rows into mysql, it loads them using a for loop.

Right now, the inserts are crossing, for example, 15 inserts from user 1, then 3 from user 2, then 5 from user 1…

How can I make it so if user 1 loads the php file first, then user 2 must wait until user 1 has finished inserting all 1000 of his rows before user 2 can begin?

  • 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-05-27T08:16:53+00:00Added an answer on May 27, 2026 at 8:16 am

    Use MySQL insert delayed, here is the docs: http://dev.mysql.com/doc/refman/5.5/en/insert-delayed.html

    It will queue your insert queries, just when a one has finish the other will begun. But if you want to join all the queries from an user before to send the second query, this will be a lite more complicated, maybe a temporary table in the memory can help you hold the user sessions table before actually make the insert. But I think that insert delayed will solve your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say you have a website for users to search for hotel rooms for rent.
I have a website I want to regexp on, say http://www.ru.wikipedia.org/wiki/perl . The site
Say there is a website with 100,000 users each has up to 1000 unique
Say I have a website called a.com , and when a specific page of
I have a website say www.livesite.com which is currently running. I have been developing
So I have a members website written in PHP and MYSQL. Say for a
Say I have a website and a database of that website hosted locally on
Let say that I have a website with some information that could be access
Say I have a file in my kohana 3 website called assets/somefile.jpg . I
Let's say that I have a Flash website where you could create an avatar

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.