Page 1 of 1

Sum calculation

Posted: Sun Mar 01, 2009 4:18 am
by thomo03
Hi there,

I've recently started programming with PHP, read a few tutorials, and manage to send info, like on a shop. A user clicks an item, and they are told they have ordered that item. The one thing I can't do is, say somebody orders an item which take 3 hours to make, yet another person makes an order, but that also takes 3 hours to make. The problem is, for that customer they are 2nd in line, so it will actually take 6 hours to make.

Is this simple enough, or does it take a lot to intergrate?! Does anybody have examples?

Thanks.

James

P.s It doesn't matter about how long people work, or how many hours there are in a day, its basically 3+3=6

Thanks

Re: Sum calculation

Posted: Sun Mar 01, 2009 5:06 am
by Mark Baker
You could at least respond to comments made on other forums where you've posted this query.

If you just wat a simple solution, then a simple multiplication is sufficient. When each order is placed, you just added up the quantity for that order, plus the number of previous incomplete orders, and multiply by three.