这是我的代码:
我想total_values
使用数组更新字段。我只是从表中获取数据然后我想更新同一个表的字段
// select query to get the value
for($j=0;$j<count($capacity);$j++)
{
$capaci=$capacity[$j];
// select query to get the value
$sql2=mysql_query("SELECT recieved-allocate*plate_quantity as ans from total_values where capacity='$capaci'");
while($fetch=mysql_fetch_array($sql2))
{
$recieves=$fetch['ans'];
$sql3="update total_values set recieved='$recieves' where capacity='$capaci' and month='$mon'";
mysql_query($sql3);
}
}