Reply to Re: Simple Quanity PHP Script?

Your name:

Reply:


Posted by Pro N00b on 10/01/72 11:13

darkjedi26@gmail.com wrote:
> I'm going to be putting up a web page where I'll be selling products
> that I only have 1 of. I'm trying to find some kind of script or
> something somewhere that will track the inventory for me so that when
> someone buys something, someone else wont be able to buy it again. It
> will show inventory 0 or sold out or something.
>
> I dont need a whole shopping cart system, just something really simple
> to count down the inventory from 1 to 0.
>
> Anyone have any ideas or know of anything?

Expecting that you already have a webshop script:
add a field in your database named `quantity`, and when someone buys
something, execute

UPDATE `products` SET `quantity` = `quantity`-1
WHERE [something that matches your product]

When listing the products, you can easily hide the sold-out products by
adding '`quantity` > 0' to your WHERE.

Hope you can do something with this.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация