Techykid3
08-12-2011, 08:25 PM
Okay, I have a "ingame store" on a game and it uses a database to store the prices and everything, and I also have an economy plugin, what I need to do is this:
I want a form that will buy it rather than in game, but on a website.
So here is what I mean: If someone wanted to buy an item, they could go to the website, find the item in a list, and when they click the link, that link contains variables, such as this:
http://mywebsite.com/shop/buy.php?id=82
But this will get a little tricky:
It needs to CHECK the price from the database containing the item list, then it would need to ADD a random code to another database (it would echo it to them, while adding the item's ID, and it's quanity like so: 82 1 (it would give them item 82, and give them only 1 of this item). And THEN, I need it to subtract the amount of money (the amount in the item database, aka the buy price) and it needs to subtract it from their username (specified via a login system). I know thats gonna be hard, I'm really getting headaches trying to figure it out.
Any help would be appriciated.
(by the way, I didn't know if I should put this in PHP or MySQL)
Hopefully you guys can help me :)
EDIT: If needed, I can put the buy price as a variable like so: http://mywebsite.com/shop/buy.php?item=82&p=20 p means price.
I want a form that will buy it rather than in game, but on a website.
So here is what I mean: If someone wanted to buy an item, they could go to the website, find the item in a list, and when they click the link, that link contains variables, such as this:
http://mywebsite.com/shop/buy.php?id=82
But this will get a little tricky:
It needs to CHECK the price from the database containing the item list, then it would need to ADD a random code to another database (it would echo it to them, while adding the item's ID, and it's quanity like so: 82 1 (it would give them item 82, and give them only 1 of this item). And THEN, I need it to subtract the amount of money (the amount in the item database, aka the buy price) and it needs to subtract it from their username (specified via a login system). I know thats gonna be hard, I'm really getting headaches trying to figure it out.
Any help would be appriciated.
(by the way, I didn't know if I should put this in PHP or MySQL)
Hopefully you guys can help me :)
EDIT: If needed, I can put the buy price as a variable like so: http://mywebsite.com/shop/buy.php?item=82&p=20 p means price.