how to update table in foreach loop with where clause
my code:
foreach($output as $var) {
$tmp = explode(",", $var);
$collec_date = $tmp[2];
$cust_id = $tmp[4];
$cust_name = $tmp[5];
$install_no = $tmp[6];
$amount = $tmp[7];
$sql = "UPDATE ankali_slabpay SET install_date='$collec_date', install_amt='$amount' WHERE ac_no='$cust_id' AND install_no='$install_no' AND $install_amt='000000' GROUP BY ac_no";
$result = mysql_query($sql);
}