View Single Post
12-04-2009, 07:17 AM
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Ok, been a while since you posted but will give you some pointers...
Break the problem down into manageable pieces, work out the logic first..
We will take it as read that the data is already in the DB..
So logic would be something like...
Get current "money" from DB
Decrease current "money" by "cost of item"
Update new balance in DB
Update/create entry for "item purchased"
Now I would point out at this stage that now it's written out a possible issue can be seen...
You have no way of tracking purchases..
So to that end, you would need another table which you would write the purchases (spelling) into, giving you the ability to track customer purchases.
So, you would have 2 tables....
1/ money, with a unique ID for each customer.
2/ purchases, with a fields holding the customer ID, Item Purchased, Cost, date/time
Anyway thats some thoughts for you if you decide to come back and have a look....
Sex, Drugs & Linux Rules
View Public Profile
Send a private message to maeltar
Find More Posts by maeltar