Re: Inventory Management for ecommerce store
| From: | Matt | Date: | Sat, 22 May 2004 10:59:03 +0000 |
| Subject: | Re: Inventory Management for ecommerce store | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34526@lists.php.net to get a copy of this message | ||
>From: "Aaron Wolski" <aaronjw@martekbiz.com> Friday, May 21, 2004 12:21 PM
> Subject: RE: [PHP-DB] Inventory Management for ecommerce store
>
> All cart records are stored to the database with a timestamp. On each
> call to the cart_script, I check to see if any records are older than 24
> hours and if they are, I dump the quantity back into inventory and
> remove the entry from the DB.
If your updates to the inventory counts are in two separate sql statements,
then you should use transactions. That's because if I hit the stop or back
button, the php script will stop executing, and some of the script and sql
won't get executed. So, you may find that you are updating all of the
tables when you scan your code, but site visitors can interrupt that
process -- especially those that hit back and forward quick. If you're using
mysql, you need to use inno_db tables in order to use transactions.
---
The future will be better tomorrow
---
http://www.spiceplace.com/
----------------------------------------