0

此代码显示了如何将两行相乘的简单结果

示例 30 天乘以 400 工资。那么我该怎么做,请帮我解决这个问题。

 <?php
    while ($runrows = mysql_fetch_assoc($run))
    {

     //get data
    $workerid = $runrows['workerid'];
    $keywords = $runrows['workername'];
    $salary = $runrows['salary'];
    $days = $runrows['days'];

    echo "<table  class='hovertable' width='100%'>";

    echo "<tr width='50%' onmouseover=\"this.style.backgroundColor='#999999';\" onmouseout=\"this.style.backgroundColor='#d4e3e5';\"><td width='20%'><a href=\"workerdetail.php?id=$id\" class=\"style1\">$workerid</a></td>
    <td width='20%'>$workername</td>
    <td width='20%'>$salary</td>
    <td width='20%'>$days</td>

    echo "</table>";
    }

    }
    }

?>
4

1 回答 1

1
 $salary = $runrows['salary'];

用上面的代码做你想做的事,乘法、减法、加法……。是基础数学,看到=标志了吗?只是放置$salary = $days * $runrows['salary'];

于 2013-01-28T13:53:01.437 回答