<?php
require_once './connectioni_branches.php';
require_once './connection_sql.php';


  	$sql_main="select * from s_mas";
	foreach ($conn->query($sql_main) as $row_main) { 
		
	
		$sql2="update s_mas set   SELLING='".$row_main["SELLING"]."',COST='".$row_main["MIN_SELLING"]."' WHERE stk_no = '". $row_main["STK_NO"] . "'"; echo $sql2.'<br>';
        $resul2 = $conn_bt->query($sql2);
		
		$sql2="update s_mas set   SELLING='".$row_main["SELLING"]."',COST='".$row_main["MIN_SELLING"]."' WHERE stk_no = '". $row_main["STK_NO"] . "'"; echo $sql2.'<br>';
	    $resul2 = $conn_ka->query($sql2);
		
		$sql2="update s_mas set   SELLING='".$row_main["SELLING"]."',COST='".$row_main["MIN_SELLING"]."' WHERE stk_no = '". $row_main["STK_NO"] . "'"; echo $sql2.'<br>';
		$resul2 = $conn_ku->query($sql2);
		 
			
	}
	
	echo "Updated";
	
	?>