You guys you are just awesome. I double checked my queries and i noticed that I was putting my code on top of the if statement that does the query. I must hv messed up unwittingly since i got stuck for a long time and kept experimenting with lots of code. So i simply had to take the closing bracket of the foreach loop and wrapped it around to make the if statement inside and voila everything updated as I needed. here is what i did:
$arrayIDs; //array containing database table IDs
$arrayVALUES; // array containing update data
$combine = array_combine($arrayIDs, $arrayVALUES);
foreach($combine as $key => $value)) {
$element = "UPDATE TableToUpdate SET
newUpdateData = '$value'
WHERE ID = '$key'";
if($connection->query($element)===TRUE){
echo "voila u hv updated";
}
}
Thanks ginerjm, Macgyver, Barand for your patience and advice.