View Single Post
  #1 (permalink)  
Old 04-21-06, 01:06 PM
billyspcs billyspcs is offline
Newbie Coder
 
Join Date: May 2005
Location: NY
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
PHP does NOT update the mysql when rapidly sent through browser - $20 REWARD PAYPAL

Hello All,

I need some help with my PHP scripts... and yes the first person who can help me solve the problem will receive 20 dollars through PayPal.

The Problem:

I own an online browser/PHP based game. (Booyacasha.com) Players can create an account and build-up their characters in a fictional world. Well, in this game players can take items and place them up for auction > which is handled all through PHP and MYSQL. Every item on the game has it's own unique id #, so if a player has that item, they simply have that id # stored in the mysql database in the same row as their username. Each players items are account info are stored in a table that looks like this: Username | Password | item1 | item2 | item3 | ...to item20

...so when they place an item up for auction my script does the following:
1) The script receives the item id # through $id = $_POST['id'];
2) Selects the row from the table of Users shown above where the username == to their username and stores it as a variable ($account)
3) then the script checks each of the $account array's elements (item1 > item20) to see if the item id # == to any of the columns (This shows if they truly have the item they are trying to auction)
4) if true ($account[item1-20] == $id) then they have the item and I take it away, by setting $account[item1-20] = ' '
5) Now i place the item in the auction by inserting into a table called 'Auction' with the values (' ID KEY ', '$username', '$id')
6) then they are sent through header("Location to the auction PHP page


...so the big problem, when a user clicks on the Auction Item button really quick the script somehow doesn't catch that the item has already been given. It is as if the script does the insert into the Auction table but never updates the Account table...

Again I will pay 20 dollars for the solution to this problem, and I have the script availible upon request.

PLEASE email support@booyacasha.com with any ideas, I will not be checking this post.

Thanks,
Bill
Reply With Quote