If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Shop DB item in the cart and available

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-18-09, 12:31
Elstefen Elstefen is offline
Registered User
 
Join Date: Jun 2009
Posts: 3
Shop DB item in the cart and available

Hi all.
someone of you has experiences about shop db?
i've a table that contains:
- name
- description
- quantity

now, when a user thakes some items i update directly the quantity value:
There are 10 bikes in the db.
the user A takes 5 bikes
i update the db to 5 bikes
all the user see that are available 5 bikes and they can buy only 5 bikes.

but this bikes is not bought. is only in the cart of the user. if the user don't complete the shop these 5 bike are still available (in fact, if the user don't pay i re put these 5 bikes inside the db).

usually, how you proceed?
update the database each time a user put items in the cart
or the update is done only when a user pay?
Example (the other case):
A takes 5 bike
no update
all the users see 10 bikes available
B takes 6 bikes, and pay
so there are 4 bikes available.
A pay: he can't pay, there are only 4 bike available.

what's the best choice?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On