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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:11:02+00:00 2026-06-08T22:11:02+00:00

I am currently coding a gambling system for a client, effectivly, the way the

  • 0

I am currently coding a gambling system for a client, effectivly, the way the system works is as follows:

  • Tickets are what we create
  • Each ticket will get assigned a certain amount of numbers per ticket
  • There are a total of 1,000,000 which are ordered randomly from 000,000 to 999,999
  • These 1 million numbers get split into tickets the amount of numbers per ticket is defined by the admin.

Now the problem is at the moment we have an array of 1 million numbers sorted randomly, this is fine, but what would be the best way to insert this into a database?

We have two tables

tickets

  • ID
  • ticketUID
  • prizeID
  • addedDate

ticketNumbers

  • ID
  • ticketID
  • number

At the moment when the user decides to add the tickets to the prize we loop through and create the total tickets which is determined by the total amount of numbers per ticket, e.g. 1 number per ticket = 1 million tickets, etc…

Now we loop through check the total numbers per ticket add how ever many from our number array then remove it from the original array so there are no duplicate numbers.

Now where the problem stems from is that this takes quite a lot of memory in this way and it causes the page to time out….

Is there another way someone can suggest to help overcome this problem?

P.S. I cannot provide source code, but this is essentially what we are doing, and what i really need is theory of other methods of how i could handle the insertion of all this data.

Thanks in advance

  • 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-08T22:11:04+00:00Added an answer on June 8, 2026 at 10:11 pm

    I’m not really into gambling, so not really sure in which way these tickets have anything to do with gambling.

    That said, if you really need to create such an amount of data, there are a few options. You could for example move the ticket-creating away from the user. What I mean with that is whenever the user decides to ‘add the tickets to the prize’ you delegate this task to another process/thread and let the user move on. Then when the creation of the tickets is done, the process notifies the user somehow.

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

Sidebar

Related Questions

I'm currently coding counter system and have spotted one problem with flash banners without
I'm currently coding a product which will have only one database but will host
I'm currently coding a CMS in PHP in order to get back into PHP
I am currently coding an application that involves navigating between pivot control. There will
I'm currently coding a button which will delete a record from a database if
I am currently coding an Android app, which will be used to count Traffic
Currently finalising the coding for my comment system, and it want it to work
I'm currently coding a little download manager and I get a funny output when
I'm currently coding, as the part of a bigger project, a webmail client. I'd
I am currently hard-coding the path to my application as follows: const char* OriginCopyFile

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.