Re: Re: bcadd

From: Date: Fri, 18 Apr 2003 03:46:41 +0000
Subject: Re: Re: bcadd
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-144371@lists.php.net to get a copy of this message
What does your loop look like? Basically, I'm interested in knowing whether you are somehow resetting or setting $TOTAL or $HOURS to zero before going to the bcadd() function. Hugh ----- Original Message ----- From: "Kevin Hoffer" <kevinh@inetplus.net> To: <php-general@lists.php.net> Sent: Thursday, April 17, 2003 8:29 PM Subject: [PHP] Re: bcadd > HOUR: 00 TOTAL_HOURS: 0 > total hours: 0 > HOUR: 01 TOTAL_HOURS: 0 > total hours: 0 > HOUR: 00 TOTAL_HOURS: 0 > total hours: 0 > HOUR: 00 TOTAL_HOURS: 0 > total hours: 0 > HOUR: 00 TOTAL_HOURS: 0 > total hours: 0 > HOUR: 00 TOTAL_HOURS: 0 > total hours: 0 > HOUR: 02 TOTAL_HOURS: 0 > total hours: 0 > HOUR: 00 TOTAL_HOURS: 0 > total hours: 0 > HOUR: 00 TOTAL_HOURS: 0 > total hours: 0 > > "Jean-Christian Imbeault" <jc@mega-bucks.co.jp> wrote in message > news:3E9F6B75.6010904@mega-bucks.co.jp... > > Kevin Hoffer wrote: > > > > > > That one works. It displays 3. > > > > Hum ... > > > > > I thought maybe it had something to do with using two variables but that > was > > > squashed when I used two variables in another section of the script. > > > > Can't quickly see what the problem could be. > > > > Try adding this in your code just for debugging and see if you can spot > > the problem: > > > > echo "HOUR: $HOUR TOTAL_HOURS: $TOTAL_HOURS<BR>"; //new > > $TOTAL_HOURS = $TOTAL_HOURS + $HOUR; > > echo "total hours: $TOTAL_HOURS<BR>"; //new > > $TOTAL_HOURS = bcadd($HOUR,$TOTAL_HOURS,0); //new > > echo "total hours: $TOTAL_HOURS<BR>"; //new > > exit; //new > > > > Jean-Christian Imbeault > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#144371) next »