Need help on bidding site

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manojujn
Forum Newbie
Posts: 1
Joined: Tue Jul 19, 2011 9:29 am

Need help on bidding site

Post by manojujn »

Hello friends,

Greetings for the day,

I am working on auction site, multiple users can bid on an :idea: auction.
Here is the url http://astealcentesimo.netsons.org/index.php
Now the problem is when i bid on the item repeatedly, and the conditions
doesn't match then dummy entry of winner goes into the database.
Ideally there should be only one winner, but when i click the bidding button
repeatedly, multiple entries of winner goes into the database.

The problem is, when one user click on the button record is not inserted yet
in the mean time other user click on it in the last moment ,
because the first record is not inserted yet so the if condition is not satisfied
so it accepts the second insert query also in this way we have two records for winner.

Can any one suggest me, solution for this problem.

:idea:

Thanks in advance
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Need help on bidding site

Post by McInfo »

Use database transactions.
Post Reply