Hi I think what your your problem is is your looking at it from the wrong point of view
What you need is two tables tbl_stock which holds the stock quantity and tbl_sales which olds the number you sell
tbl_stock
1,bags,10
2,shoes,10
3,hats,15
4,socks,15
tbl_sales
This is where you hold the the number of items sold per transaction
each time a bag is sold
tbl_sales
1,bag,0 then a sales happens 1,bag,1 then another sale happens 1,bag,2 lets say you sell 5 bags in that week
1,bag,5
you then write the script linking id <===> id
you then tbl_stock - tbl_sales for id<===> id
that way you have control
if tbl_stock - tbl_sales < 4 then "Time to restock"
if tbl_stock - tbl_sales = 0 then "Sold Out"
or just remaining = tbl_stock - tbl_sales
eg.
[tbl_stock].[count] - [tbl_sales].[count] 10-5 = 5
for your bags
where count being the number field in each of the rows
I am sure you know about unique ID etc so I mean the stock.
There are other ways such as just removing the the count each time from tbl_stock
------------------------------------------------------------------------------
However you could do the same thing in one table
tbl_Stock
1,Bag,10,(x)
2,Shoes,15,(x)
Where (x) is incremented at each sales you then just take [tbl_stock].[field3] - [tbl_stock].[field4]
and create the same above If conditions.
Personally I would go for this one as only one table is nessesary to refernece with no outjoins speeding up the process.
that way tbl_stock stands on it own as I have one set like this
tbl_stock
1,Cat 5e cable,2000,650,200,10,.99
field1 = ID (unique key)
field2 = Descritption
field3 = Maximum Stock Quantity
field4 = Sold quantity
field5 = Restock at quantity
filed6 = Minimum sale quantity
filed7 = cost per meter
The rest you use your script to tell you what's going on and other to update that field as and when.