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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:48:11+00:00 2026-05-11T21:48:11+00:00

My web app allows users to upload a bunch of photos simultaneously to the

  • 0

My web app allows users to upload a bunch of photos simultaneously to the server, and then stores them in a database. When the first photo finishes uploading, it should create a default album based on today’s date, and add it to that. But what if photo1 completes, looks for the album, and can’t find it so it decides to create it, but before it can, photo2 completes and also can’t find it, so then they both try to create the same album, causing one to fail? This would probably be very highly unlikely, but could happen I reckon. Or do most web servers process only one PHP script at a time?

Would this be a valid and good solution?: Instead of photo1 checking if the album exists first, it just tries to create it. If it throws back an error 1062 (duplicate entry), THEN it selects it. Then it shouldn’t matter which finishes first if you think about it… I just don’t know if catching errors will come as a big performance hit. If I’m uploading 200 photos, then 199 of them will fail the insert query, and then try select. If the other solution works correctly, 199 will succeed and one will miss.

Thoughts?

  • 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-11T21:48:11+00:00Added an answer on May 11, 2026 at 9:48 pm

    Combine both

    Check if it exists and if it does join

    if not try to create one

    if that doesnt work start the whole thing again

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

Sidebar

Related Questions

I'm developing an app that allows users to upload their photos to my web
We have a web application that allows users to upload photos which will then
I have developed a small web app. This app allows users to upload images.
I'm developing a web app which allows users to upload images. Instead of forcing
I have a web-app that allows users to upload and download image files by
Im currently building an web-app that allows users to upload content via blobstore and
I'm writing a web application that allows users to upload documents importing them directly
For a contact management system web app that allows tennants to upload lists of
I'm building an web app with PHP where users upload images and they're displayed
I'm writing a web app that at one point allows a user to upload

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.