<?php  session_start();

/*
	include_once("config.inc.php");
	include_once("DBConnector.php");
	$letters = $_GET['letters'];
	
	$sql="SELECT * FROM mast_family where name like '".$letters."%'";
		$result =$db->RunQuery($sql);
			
			
			while($row = $result->fetch())
			{
			
			echo $row["name"];
			
			}
			
		*/	
		
		



	include_once("connection.php");


	$sql1 = "update s_submas set QTYINHAND=0 ";
	$result1=$dbinv->query($sql1);	
	//$row1 = $sql1->fetch();
	
//$sql_item = $dbinv->query("select * from s_mas where BRAND_NAME='CHENG SHING' and STK_NO='06010' order by STK_NO") or die("Error";				
$sql_item ="select * from s_mas order by STK_NO";		
$result_item=$dbinv->query($sql_item);			
while($row_item = $result_item->fetch()){	
  $M_BAL = 0;
  	$sql1 = "update s_submas set QTYINHAND=".$row_item["QTYINHAND"]." where STK_NO='".$row_item["STK_NO"]."' and STO_CODE='1'";
	$result1=$dbinv->query($sql1);			
//	$row1 = $sql1->fetch();
	
 
}
	
?>

