Re: Newbi Question with calculate

From: Date: Wed, 06 Apr 2011 15:14:47 +0000
Subject: Re: Newbi Question with calculate
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-312280@lists.php.net to get a copy of this message
I will give you a mysql example. Apply the logic to the table during the query so you can just loop over the results like such. $ABEI=12; $query = ' select last * '.$ABEI.' AS resulta From table'; Sent via DROID on Verizon Wireless -----Original message----- From: Silvio Siefke <lists@silvio-siefke.de> To: php-general@lists.php.net Sent: Wed, Apr 6, 2011 12:50:20 GMT+00:00 Subject: [PHP] Newbi Question with calculate 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

« previous php.general (#312280) next »