My program starts like this:
START | B | S | P |
4000 | 215.05 | 4182.72 | 182.72 |
where:
B = Buy
S = Sell
and
P = Profit.
I'm calculating the values this way:
bv = 18.60; //fixed value
sv = 19.45; //fixed value
START = 4000; //fixed value
B = (START/bv);
S = (B*sv);
P = (S-START);
How can I manage to store the "SELL" value inside "START" as a loop and recieve a table like this:
START | B | S | P |
4000 | 215.05 | 4182.72 | 182.72 |
4182.72| 224.87 | 4373.72 | 191.00 |
??
I tried:
$start= 4000;
//$inic = $cashinic;
$bv= 18.6; //buy value
$sv= 19.45;//sell value
$buy= ($start/$bv);
$sell = ($comp*$sv);
$profit = ($sell-$start);
for($i = 1; $i<=100; $i++)
{
?>
<tr>
<td><div align="center"><?php echo $start; ?> </div></td>
<td><?php echo $buy; ?></td>
<td><?php echo $sell; ?></td>
<td><div align="center"><?php echo $profit; ?> </div></td>
</tr>
<?php
}
?>
</table>
but it only gives me this results:
START | B | S | P |
4000 | 215.05 | 4182.72 | 182.72 |
4000 | 215.05 | 4182.72 | 182.72 |
4000 | 215.05 | 4182.72 | 182.72 |
.... | ...... | ....... | ...... |
and so on... I'd really appreciate your help.
Do I need another column which will be the auto increment one?
Something like this:
Col_index |START | B | S | P |
1 | 4000 | 215.05 | 4182.72 | 182.72 |
2 | ... | ... | ... | ... |
P.D. I'm not using a database, is it necessary? (mostly because I don't think I need a database)