Hi everyone,

Some quick background before I get to my question:

I have developed a fantasy football game that is based on an auction style
format.  In any given game there are a consistant number of players, usually
10 or 12.  There can be more than one game taking place at the same time on
the site.  All 12 players are trying to put together the best team they can
with a limited amount of fictional money, in this case $200.  A typical
auction lasts around 90 minutes, and consists of a whole lot of furious
refreshing of the auction board by the participants since each player only
has a 2 minute clock.  It might be easiest to demonstrate what this looks
like by copying some data from an actual "auction board":

*****at the top there is a refresh button****

$1  Bid On:  L Tomlinson, RB SDC
 High Bid: You!
 Timer: 0m 25s

$2  Bid On:  P Holmes, RB KCC
 High Bid: You!
 Timer: 0m 35s

$2  Bid On:  C Portis, RB WAS
 High Bid: You!
 Timer: 0m 38s

$2  Bid On:  A Green, RB GBP
 High Bid: You!
 Timer: 0m 42s

$2  Bid On:  D McAllister, RB NOS
 High Bid: You!
 Timer: 0m 45s

.
.
.

When the player at the top goes to Timer: 0m 0s whoever has the high bid is
awarded that player.  Then a player is pulled off of a list that the
auctioner who "nominated" that player created, and that player has a full
clock and goes to the bottom of the list.

The question:

Since there is so much clicking going on, and my php code and mysql calls
(including the transactions that decide which new player should be nominated
to the board) obviously happen with each user click, is there any way to
hide the guts of the work so that when they click refresh all they are doing
is viewing the state of the respective tables at that time.  In other words,
I don't need 4 people simultaneously calling the functions that decide which
player should be nominated next, awarded the player that was won to the
necessary roster, deducting money, etc.  With four people calling the
function at once, I am forced to lock up the rows and rollback 3 of the
transactions.  Is there any way to have them all call the same function that
only gets executed once?

Another related question would be, would it make sense to create a cronjob
that would go through the behind the scenes functions every one or two
seconds, thereby spreading the load and sparing the end user from being
involved in activating the use of the functions?  Or is the natural
"burstable" patterns that human users create actually easier on the server
and a more natural way of doing things.

I know I've thrown alot of stuff out there for you guys, but I'm just
wondering if there is a better way from how I am doing things at present.
Any help or advice would be greatly appreciated.

Jeremy


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to