<?php
session_start();
$branch=$_SESSION['branch_id'];
$business=$_SESSION['business_id'];
include '../includes/connection.php';
$idd=$_GET['id'];



$sql = "SELECT * FROM stores where product_name=(select product_name from products where id= '$idd') && business_id='$business'";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
$row = mysqli_fetch_assoc($result);
$quant=$row['quantity'];
if (strlen($quant)<1) {
	$quantity=0;
        
}else{
	$quantity=$quant;

}
        
        echo $quantity;
       
    
} else {
    echo "0 results";
}

?>