<?php

    
    //include 'common/connection.php';
    $servername = "localhost";
    $username = "finstech_sales";
    $password = "SalesApp@123";
    $dbname = "finstech_salesapp";
    
    
    try {
        $conn = mysqli_connect($servername,$username,$password,$dbname);
        if(!$conn)
        {
            trigger_error('Could not Connect' .mysqli_connect_error());
        }
        $sql = "select * from master_staff";
        $result = mysqli_query($conn, $sql);
        $array = array();
        while($row=mysqli_fetch_assoc($result))
        {
            $array[] = $row;
        }
        echo'{"staffs":'.json_encode($array).'}'; 
        $conn = null;
    }catch(PDOException $e) {
        echo $sql . "err" . $e->getMessage();
    }
    $pdo = null;
    
?>