<?php
include("../include/session.php");
    
	$query = "SELECT productId, productName FROM nam_products WHERE productName = '". $_SESSION['item_name']."'" ;
	$result = mySQL_query($query) or die ("Error in query:   $Query . * ". mySQL_error());
	$num = mysql_num_rows($result);
	
	if ($num==0) { 
	?>
    <script language="javascript" type="text/javascript">
           window.location="editWizbase.php?p=37&s=";
     </script>
 <?php
	} 
	else { 
	 $productId = mysql_result($result, 0, "productId"); 
	 		?>
        <script language="javascript" type="text/javascript">
		   window.location="editStockItem.php?productId=<?php echo $productId ?>&edit=0";
     </script>
	<?php
	}
	?>