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



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

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

    while($row = mysqli_fetch_assoc($result)) {
    	?>
    	<option value="<?php echo $row['id'];?>"><?php echo $row['product_name'];  ?> <?php echo $row['product_code'];  ?></option>
       <?php
    }
    
} else {
    echo "0 results";
}

mysqli_close($conn);
?>
