<?php 
include_once '../../config/connect.php';
$select = mysqli_query($link, "SELECT SUM(amount) FROM loan_info WHERE pay_date < '$date' AND amount_topay > 0") or die (mysqli_error($link));

while($row = mysqli_fetch_array($select))

{

$select1 = mysqli_query($link, "SELECT * FROM systemset") or die (mysqli_error($link));

while($row1 = mysqli_fetch_array($select1))

{

$currency = $row1['currency'];

echo $currency.number_format($row['SUM(amount)'],2,".",",")."</b>";

}

}

?>