update query not working in array
- by Suresh PHP Begginer
here my code: i want to update the field by array. i just fetch the data's from table then i want to update the the field for same table
// 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);
}
}