Re: Newbi Question with calculate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think you want to use the FOR loop to process each record in your table. 
You query (?) the table and then process each row in the result using the 
FOR and all your calculations on each one.  Look up FOR.
"Silvio Siefke" <lists@xxxxxxxxxxxxxxxx> wrote in message 
news:4D9C6165.5040700@xxxxxxxxxxxxxxxxxxx
> Hello,
>
>
> i have write a script for my Stock portfolio and now im not really find
> something which can me help.
>
> In the table php calculate me the Present Value and the Percent with
> this code:
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> <?php
> //Quantity
> $ABEI = 240;
>
> //Buy Quote
> $KKBEI = 41.31;
>
> //Buy Balance
> $KWBEI = 9914.40;
>
> //calculate
> include("../inc/quote.php"); // Yahoo Quotes
> $BEIERG = $KKBEI*$ABEI; // Buy Balance
> $BEIDW = $BEIQuote['last']*$ABEI; // Present Value
> $BEIAEN1 = $BEIQuote['last']-$KKBEI; // Quote Win
> $BEIAEN = $BEIAEN1*100/$KKBEI; //Percent Win
> ?>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> Is it possible to apply logic to the whole table? Or do I write for each
> additional item the same source code?
>
>
> It were nice someone has a Tip for me? Thank u.
>
>
> Silvio 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux