I've got 3 different tables and I want to update the 4th table with some specific column from each of the 3 tables, they all have a common key. I can do this from the phpmyadmin, but I want to do it using a php script. This is what I tried but it didn't work
if (isset($_GET)) { 
    $update = '';
    $count="SELECT * FROM test2   ";          
    foreach ($connect->query($count) as $row) {
         $term_total1=$row['english'];
         $sql = "UPDATE total set `f_test` ='$term_total1'  ";
         foreach ($connect->query($count) as $row) {
             echo "success<br>" . $term_total1;
         }
    }  
}else{
    echo "try another method" . mysqli_error($connect);
}
Have been trying for days now.
Repeated the same code for the other two tables but it won't work. Is it possible to do it in a single query? If Yes, then how
 
     
    