I have a php code and database. From the kurs table I need to take one value. And this value should be multiplied to variables. I was able to pull out the cell that I need. But could not perform the desired arithmetic operation.

 <?php $sdd_db_host='localhost'; $sdd_db_name='mybase'; $sdd_db_user='admin'; $sdd_db_pass='qwerty'; @mysql_connect($sdd_db_host,$sdd_db_user,$sdd_db_pass); @mysql_select_db($sdd_db_name); $result=mysql_query("SELECT * FROM kurs where id=1"); while($row=mysql_fetch_array($result)) { echo '<td width="85"><div align="center">'.$row[Продажа].'</div></td>'; } ?> 

Closed due to the fact that the question is too general for the participants Dmitriy Simushev , VenZell , zRrr , user194374, Streletz 17 Jun '16 at 6:54 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

      while($row=mysql_fetch_array($result)) { $var = $row[Продажа]; // Делайте с $var нужную арифметическую операцию echo '<td width="85"><div align="center">'.$var.'</div></td>'; }