<?php
include('../db_conx.php');

// now we will get the link...
$user_view_id = $_GET['userID'];

$loanID = $_GET['loanID'];
$amt = $_GET['amt'];

$sql_loan = "UPDATE loan SET loan_status = 1 WHERE id = '$loanID'";
$query_loan = $db_conx->query($sql_loan);

if ($query_loan) {

    echo "Success";
    header('location:../../principal/loan_list.php?approveLoan=true&userID=' . $user_view_id);
} else {
    echo "failed";
}
