I have a table in MySql table with many rows of records (existingbankproducts table):
The code I use to select is from the database is below:
$stmt2 = $DB_con->prepare("SELECT * FROM applicantpersonaldetails apd "
. "INNER JOIN existingbankproducts ext ON apd.ApplicantID = ext.ApplicantID "
. "WHERE apd.AccountID ='{$accountId}' AND apd.applicantType ='main';");
$stmt2->execute();
if ($stmt2->rowCount() > 0) {
while ($row = $stmt2->fetch(PDO::FETCH_ASSOC)) {
?>
<?php
}
} else {
?>
<div class="">
<div class="alert alert-warning">
<span class="glyphicon glyphicon-info-sign"></span> No Data Found ...
</div>
</div>
<?php
}
I want to select them and insert to my HTML table, the code is below:
<table>
<tr>
<th>Financial Institution</th>
<th>Product Type</th>
<th>Balance</th>
<th>Monthly Commitment</th>
</tr>
<tr>
<td><input type = "text" name = "finanIns1" id = "finanIns1" value = ""readonly></td>
<td>
<input list = "proTypeList" name = "proType1" id = "proType1"readonly >
</td>
<td id = "balance"><input type = "number" name = "balance1" id = "balance1" value = "" min = "0"readonly></td>
<td id = "MonthyComm"><input type = "number" name = "monthlyComm1" id = "monthlyComm1" value = "" min = "0"readonly></td>
</tr>
<tr>
<td><input type = "text" name = "finanIns2" id = "finanIns2" value = ""readonly></td>
<td>
<input list = "proTypeList" name = "proType2" id = "proType2" readonly>
</td>
<td id = "balance"><input type = "number" name = "balance2" id = "balance2" value = "" min = "0"readonly></td>
<td id = "MonthyComm"><input type = "number" name = "monthlyComm2" id = "monthlyComm2" value = "" min = "0"readonly></td>
</tr>
</table>
Actually, there are more rows, this is an example.
Also, I put value="<?php echo $row['Financialinstitution'] " ?> as an example, However, all the records are coming out.
Is there any way to display the result according to the HTML table in order.
