<?php 
require_once('db.php');        $item=1; //$data=[];
error_reporting(0) ;




// gurantor loan limit 

if(isset($_POST["g"]))
    {     $id = $_POST['g'];             
          
          $stmt = $conn->prepare("SELECT sum(dr)  as amount FROM pls_fixeddeposit  WHERE member=:i  ");
          $stmt->execute(['i'=>$id ]); 
          $row = $stmt->fetch(); //extract($row);
     
            
              $data["savings"] = $row["amount"];
             //$data["unit"] = $item;
        
    }

 echo json_encode($data);
?>
