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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:47:05+00:00 2026-05-26T21:47:05+00:00

Hi I need to be able to insert a random value between 1-1000 in

  • 0

Hi I need to be able to insert a random value between 1-1000 in to the “left” field and a random value between 1-1000 in the “top” field or a database row – however I want it to check if the “left” and “top” dont already have the 2 proposed values?

lets say left has been randmomly assigned the value 23 and top has been randomly assigned the value 967, if in the database it has already got an entry with left being 23 and top being 967 then randomly assign 2 new values that are not taken?

Cheers

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

    This is pseudocode, but it shows the sequence of events:

    $exists = 1;
    
    do
    {
      // GENERATE $left and $top
    
      $query_results = /* SELECT * FROM table WHERE left = $left and top = $top */
    
      $exists = /* number of rows on $query_results */;
    
      if ($exist == 0)
      {
        // INSERT $left, $top INTO table
      }
    
    }
    while ($exists > 0); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to insert a proxy between my application and the
I just need to be able to insert a key/value pair into an object
I need to be able to insert/update objects at a consistent rate of at
I need to be able to run an Oracle query which goes to insert
I need to programmatically insert a row into an Excel Spreadsheet multiple times. I
I need to be able to access my database, which in it's own isn't
I'm not able to insert data to a field of type xml. looks like
I need to be able to insert numbers like 098532 into my table. This
I'm just a beginner at VB.NET... I want to be able to insert a
I hope I am able to explain this properly. I need to insert data

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.