I have a HTML table and the data is from the database. I've then added a second table.
The table is shown by clicking the row. The row is expanded and shows the second table.
What is wrong with my code? It gives data from database but it doesn't loop. For example, I'm expecting 3 rows, but it only output one row.
The query is correct.
This is the code for the second table,
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Date filled</th>
<th>Date signed</th>
</tr>
</thead>
<tbody>
<tr>
<?php
require_once 'dbconfig.php';
try {
$conn = new PDO("mysql:host=$host;dbname=$dbname",
$username, $password);
$_tempp1 = $row1['tracknum'];
$stmt = $conn->prepare("CALL sp_gettransactsignatory(?)");
$stmt->bindParam(1, $_tempp1, PDO::PARAM_STR, 30);
$stmt->execute();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ ?>
<tr>
<td><?php echo $row['signatoryname'] ?></td>
<td><?php echo $row['datefilled'] ?></td>
<td><?php echo $row['datesigned'] ?></td>
</tr>
<?php
}
} catch (PDOException $pe) {
die("Error occurred:" . $pe->getMessage());
}
?>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>before<?phpand</tr>before</tbody>. Also some;are missed too. that's may not a big deal