<?php
include "../../inc/inc.koneksi.php";

$sql = mysql_query("SELECT * FROM stock ORDER BY kode_st");

while($r=mysql_fetch_array($sql)){
    $kodest = $r[kode_st];
	
	$sql1   = mysql_query("SELECT * FROM stock21 WHERE kode_st='$kodest'");
	$r1     = mysql_fetch_assoc($sql1);
	$stoktl = $r1[stok_tl];
	
    mysql_query("UPDATE stock SET stok_tl=$stoktl WHERE kode_st='$kodest'");
} 

echo "Koreksi stok awal tahun selesai.";
?>
