sums, averages stuff help

sums, averages stuff help

am 24.10.2007 18:24:43 von someusernamehere

Hey people, I need to do some sistem in PHP and MySQL, I have do it a
part but the other is the problem, basically is mathemetical
operations, te user register something and after insert some registry
and after is needed obtain sums, averages and something similar, does
anyone have some code similar for read about??

kisses, Elena

Re: sums, averages stuff help

am 24.10.2007 22:05:22 von Brendan Gillatt

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

someusernamehere wrote:
> Hey people, I need to do some sistem in PHP and MySQL, I have do it a
> part but the other is the problem, basically is mathemetical
> operations, te user register something and after insert some registry
> and after is needed obtain sums, averages and something similar, does
> anyone have some code similar for read about??
>
> kisses, Elena
>

foreach ( $list_of_values as $value ) {
$total += $value;
}

$mean = $total / count ( $list_of_values );

- --
Brendan Gillatt
brendan {at} brendangillatt {dot} co {dot} uk
http://www.brendangillatt.co.uk
PGP Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD7433
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)

iD8DBQFHH6WCkA9dCbrNdDMRAnXVAKDcLxUEJfvOXPGRIKzLvc+oV2eVTQCg j7pd
xEiAKAtc4enMbWz8pl/OO4s=
=LkQ1
-----END PGP SIGNATURE-----