1
Good evening, you guys,
I bring in a table a result of a select
of a bank, but in the result:
echo"". $T_TOTAL."";
I’m bringing a variable because I had to do a treatment to get my result.
Doubt: How can I add the result of the variable?
<?php
echo"<table class='datatable table table-hover table-bordered table-responsiv'>";
echo"<thead>";
echo"<tr>";
echo"<th>CELULAR</th>";
echo"<th>DESCRIÇÃO</th>";
echo"<th>TEMPO</th>";
echo"<th>VALOR</th>";
echo"</tr>";
echo"</thead>";
echo"<tbody>";
echo"<tr>";
while ($row = mysql_fetch_array($query_pesquisa)) {
$TEMPO=$row['VALOR'];
$T_TOTAL=$TEMPO / 6 * 0.015 ;
echo"<td>".$row['CELULAR']."</td>";
echo"<td>".$row['DESCRICAO']."</td>";
echo"<td>".$row['MINUTOS']."</td>";
echo"<td>".$T_TOTAL."</td>";
echo"</tr>";
}
echo" </tbody>";
echo" </table>";
?>
Good afternoon, but I need that calculation (6 * 0.015), if I let it not go right ?
– Chefe Druida
It was just a suggestion because if this expression is fixed, then I suggested to leave the calculated value. Therefore, 6 multiplied by
0.015
results0.09
. But if you want you can leave it as6 * 0.015
. Of course it’s a ridiculous performance gain, but anyway it’s a logic for optimization. The fewer processes to achieve the same result and, efficiently, the better.– Daniel Omine
Um got it, thanks for detailing and it’s exactly what I needed,.
– Chefe Druida