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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:59:06+00:00 2026-06-08T01:59:06+00:00

I am building an auction site for a client and I have a problem

  • 0

I am building an auction site for a client and I have a problem where I need to remove bids from the bid table until a certain point, that point is determined by the number of bidders or a reserve price.

Let me explain further. I have a table with data:

Bidder1 $7,250.00  Sat 21 Jul 2012 12:25:44
Bidder2 $7,000.00  Sat 21 Jul 2012 12:26:34
Bidder1 $6,250.00  Sat 21 Jul 2012 12:25:44
Bidder2 $6,000.00  Sat 21 Jul 2012 12:26:11
Bidder1 $5,250.00  Sat 21 Jul 2012 12:25:44
Bidder2 $5,000.00  Sat 21 Jul 2012 12:25:34
Bidder2 $1,100.00  Sat 21 Jul 2012 12:23:53
Bidder1 $1,000.00  Sat 21 Jul 2012 12:22:33
Bidder1 $550.00    Sat 21 Jul 2012 12:22:33
Bidder2 $500.00    Sat 21 Jul 2012 12:22:23
Bidder2 $100.00    Sat 21 Jul 2012 12:22:23

As you can see there are 2 bidders fighting it out. Now each bidder is able to cancel their bids at anytime however, say bidder2 cancels their bids, the system flags all bids on the auction as cancelled (client requirement) not just their latest one. If that is the case (bidder2 cancels their bids) then bidder1’s bids should roll right back to $1000 which is the reserve price for the auction (as you should be able to tell because there are 2 bids in a row from bidder1, $550 and $1000).

Heres what I am hoping is just the tricky bit and not the impossible bit. Say I have 3 bidders:

Bidder1 $7,250.00  Sat 21 Jul 2012 12:25:44
Bidder2 $7,000.00  Sat 21 Jul 2012 12:26:34
Bidder3 $6,250.00  Sat 21 Jul 2012 12:25:44
Bidder2 $6,000.00  Sat 21 Jul 2012 12:26:11
Bidder1 $5,250.00  Sat 21 Jul 2012 12:25:44
Bidder2 $5,000.00  Sat 21 Jul 2012 12:25:34
Bidder3 $1,100.00  Sat 21 Jul 2012 12:23:53
Bidder1 $1,000.00  Sat 21 Jul 2012 12:22:33
Bidder1 $550.00    Sat 21 Jul 2012 12:22:33
Bidder2 $500.00    Sat 21 Jul 2012 12:22:23
Bidder2 $100.00    Sat 21 Jul 2012 12:22:23

If bidder2 cancels their bids then I need to roll back until the latest bid of bidder3 but still with bidder1 winning.

Any guidance is appreciated.

  • 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-08T01:59:09+00:00Added an answer on June 8, 2026 at 1:59 am

    first count total no. of bidders

    $result = mysql_query("select distinct(bidder_id) from table where bid_id=1");
    

    //consider we want to remove bidder_id=2 bids

    if(mysql_num_rows($result) == 2 ) {
     //select min bid of bidder
     $row = mysql_fetch_row(mysql_query("select * from table where bidder_id=2 order by bid_price asc limit 1"));
    
     $bidder_min_amount = $row['bid_price'];
     $bidder_min_id = $row['id'];
    
     //find out other bidder min bid id 
        /*
        Bidder1 $7,250.00  Sat 21 Jul 2012 12:25:44
        Bidder2 $7,000.00  Sat 21 Jul 2012 12:26:34
        Bidder1 $6,250.00  Sat 21 Jul 2012 12:25:44
        Bidder2 $6,000.00  Sat 21 Jul 2012 12:26:11
        Bidder1 $5,250.00  Sat 21 Jul 2012 12:25:44
        Bidder2 $5,000.00  Sat 21 Jul 2012 12:25:34
        Bidder2 $1,100.00  Sat 21 Jul 2012 12:23:53
        Bidder1 $1,000.00  Sat 21 Jul 2012 12:22:33
        Bidder1 $550.00    Sat 21 Jul 2012 12:22:33
        Bidder2 $500.00    Sat 21 Jul 2012 12:22:23
        Bidder2 $100.00    Sat 21 Jul 2012 12:22:23
        //may be first case like this
        Bidder1 $75.00    Sat 21 Jul 2012 12:22:33
        */ 
        //finding out if Bidder1 $75.00 exist
        $row = mysql_query("select * from table where bid_price <= $bidder_min_amount and bidder_id!=2 order by bid_price asc");
        if(mysql_num_rows($row) > 0 ) { 
         mysql_query("delete from table where id > ".$row['id'] );
        } else {
          $row = mysql_query("select * from table where bid_price >= $bidder_min_amount and bidder_id!=2 order by bid_price asc");
          if(mysql_num_rows($row) > 0 ) { 
             mysql_query("delete from table where id > ".$row['id'] );
            }
        } 
    } //first condition complete if total bidder is 2
    else {
        //if n bidders just remove the bids of bidder
        mysql_query("delete from table where bidder_id=2");
    }
    

    Hope this will help u.

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

Sidebar

Related Questions

I need expert advises about building an auction web site in general and I
I'm building an auction site and the user can bid on the same item
We're building a site that will have very minimal code, it's mostly just going
In the ASP.NET MVC site I am building, I have some methods where the
I'm building a site with CakePHP which I would like to have 3 sections:
I have the following form_for declaration in a Rails site I am building: form_for(form_question,
I am building a penny auction site and I got to the part with
I'm building a job site where you have two types of users who sign
I am building a simple auction application. I need auctions to start and end
I'm building a site where i need to be able to notify a user

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.