// Updating the values in the table '.$tablename.' | ';
$log->debug("Converting values in the table :".$tablename);
//Sending the current status to the browser
for($k=0; $k < $adb->num_rows($res1); $k++)
{
$whereStr = "";
for($l=0; $l < count($key); $l++)
{
$id[$l] = $adb->query_result($res1, $k, $key[$l]);
if($l != 0)
$whereStr .= " and ";
$whereStr .= $key[$l]."=?";
}
$updateStr = "";
for($j=0; $j < count($cols); $j++)
{
//Converting the html values to utf8 chars
//echo "
Updating the value of ".$cols[$j]." column with utf8 value";
$val[$j] = html_to_utf8(decode_html($adb->query_result($res1, $k, $cols[$j])));
if($j != 0)
$updateStr .= ", ";
$updateStr .= $cols[$j]."=?";
}
$updateQ = "UPDATE $tablename SET $updateStr where $whereStr";
$params = array($val, $id);
$adb->pquery($updateQ, $params);
}
// echo '
// Completed |
//
';
//Sending the current status to the browser
}
}
// echo '