<?php
 echo "";
include '../includes/connection.php';
// Create connection



$sql = "SELECT * FROM products WHERE NOT EXISTS (SELECT * FROM getstock where product_id=products.id) && business_id='$business' && status=1";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
    // output data of each row

    while($row = mysqli_fetch_assoc($result)) {
        $bid = $row['branch_id'];
        $sql1 = mysqli_query($con,"SELECT * from branches where branch_id='$bid'");
        $row1 = mysqli_fetch_assoc($sql1);
    	?>
    	<option value="<?php echo $row['id'];?>"><?php echo $row['product_name']; ?>(<?php echo$row1['branch_name'];?>)</option>
       <?php
    }
    
} else {
    echo "0 results";
}

mysqli_close($conn);
?>
