You might read the database to see how many have been sold previously
and put that into a PHP variable. Add the amount that you'd be
incrementing it by (I assume it's possible that it will increment by
more than one at a time), determine the price point, and then update
the row with both the new amount sold, and the new price.

connect to db
select db
get previous number sold from db
add current sales to previous sales
determine new price point
update database row with the new number sold and the new price point
--end algorithm--

The problem with this is that if one update fails, both fail. This
might be what you'd want. 

--- SpiderWebb <[EMAIL PROTECTED]> wrote:
> I dont know if this is possible in PHP (Newbie) im working on a
> project
> where each product has 3 diffierent prices depending on the amount
> sold so
> say for example 1- 100 price A 101-299 price B and above 300 Price
> C.  What
> I need to be able to do is increment an mysql database field each
> time an
> item is sold then look at that field to decide which price variable
> to write
> to the price field of the database. Could someone point me in the
> right
> direction where I could solve this or to someone who could
> Thanks in advance.
> Spiderwebb
> -- 
> PHP Database Mailing List (
> To unsubscribe, visit:

Mark Weinstock
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to