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. --algorithm-- 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 <spiderwebb@ec-sys.com> 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 (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > ===== Mark Weinstock mark_weinstock@yahoo.com *************************************** 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. http://mailplus.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php