<?php
include '../includes/connection.php';
$customer=$_GET['customer'];
session_start();
$branch=$_SESSION['branch_id'];
$sql = "SELECT * FROM sales where customer_name='$customer' && contact!='' and branch_id='$branch'";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
$row = mysqli_fetch_assoc($result);
        $contact=$row['contact'];
    echo $contact;
} else {
    echo "";
}

?>