The problem that I am having now is that I will be getting duplicated data if My MySql tables have the data inside. However, if one of my tables is empty, all data is not able to be shown.
This is my code below:
$stmt = $DB_con->prepare("SELECT * FROM applicantpersonaldetails apd "
. "JOIN employementdetails ed ON apd.ApplicantID = ed.ApplicantID "
. "JOIN sourceoffunds sof ON apd.ApplicantID = sof.ApplicantID "
. "JOIN existingbankproducts ext ON apd.ApplicantID = ext.ApplicantID "
. "WHERE apd.AccountID ='{$accountId}' AND applicantType ='joint1';");
$stmt->execute();
if ($stmt->rowCount() > 0) {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
extract($row);
echo $row['EmploymentStatus'];
?>
<?php
}
} else {
?>
<div class="">
<div class="alert alert-warning">
<span class="glyphicon glyphicon-info-sign"></span> No Data Found ...
</div>
</div>
<?php
}