<?php
//database connection code here

require_once('shikanisha.kts.php');

$query = "SELECT ca.acc_id, c.full_name, ca.amount_owed, c.phone_number
          FROM client_acc ca
          JOIN customers c ON ca.client_id = c.customer_id";

$result = mysqli_query($conn, $query);

$data = array();

while ($row = mysqli_fetch_assoc($result)) {
    $data[] = $row;
}

header('Content-Type: application/json');
echo json_encode($data);
?>
