How to calculate multiplication value inside the while loop in PHP?

后端 未结 4 1093
臣服心动
臣服心动 2021-01-26 14:09

I have one while loop which displays data from the database. Now I want multiply two values in one row and display the result in the same row, the same way multiply the values

4条回答
  •  长发绾君心
    2021-01-26 14:50

    Try below :

     while($row = mysql_fetch_array($result))
        {
           echo "";
           echo "" . $row['id'] . "";
           echo "" . $row['item'] . "";
           echo "" . $row['amount'] . "";
           echo "" .($row['item'] * $row['amount']). "";
           echo "";
         }
    

提交回复
热议问题