Sum calculation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thomo03
Forum Newbie
Posts: 1
Joined: Sun Mar 01, 2009 4:16 am

Sum calculation

Post 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
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Sum calculation

Post 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.
Post Reply