<?
session_start();
include("test.php");
include("opendb.php");
$tbl1="stocksummary".$brcode.$user;

 $re=mysqli_query($db,"select * from $tbl1 where partname='$val' and brcode='$brcode'  ")or die('prt err:'.mysqli_error($db));//where brcode='$brcode' and partname like '$q%' "

 
        
	 $row=mysqli_fetch_array($re);
     
         
        $flg=$row[4];


       

   print"<script>document.getElementById('spare_total').value='tst'</script>";   
?> 

<input type='text' name='typ_val' id='typ_val' value='<? echo $flg;?>'>

