I am trying to iterate the row data of each message for each value in the database by a checkbox as when clicked you get the string value on this row
the Code:
<div id="Ticket" style="display:none;" class="tabcontent">
<table class="table">
<thead>
<tr>
<th>Ticket ID </th>
<th>username</th>
<th>Data published</th>
<th>Subject</th>
<th>problem</th>
<th>Statues</th>
<th>Solved?</th>
<th>More Details</th>
</tr>
</thead>
<tbody>
<?php
$query=" Select * FROM tickets where resolved=0";
$result_opened = mysqli_query($db, $query);
while($row = mysqli_fetch_array($result_opened)){ ?>
<tr>
<td data-label="id"><?php echo $row['id']?></td>
<td data-label="username"><?php echo $row['username']?></td>
<td data-label="publish"><?php echo $row['published']?></td>
<td data-label="subject"><?php echo $row['subject']?></td>
<td data-label="problem"><?php echo $row['problem']?></td>
<td data-label=""><a href="#" class="btn btn__active">Open</a></td>
<td> <a href="resolve.php?id=<?php echo $row['id']?>" class="btn btn-warning" ><i class="fa-solid fa-circle-check"></i> </a> <br/><br/>
</td>
<td><input type="checkbox" id="toggle">
<label for="toggle">see more</label>
<dialog >
<h>Message</h><br><br>
<p>
//Here I am getting only the first value//
<?php echo $row['message'] ?>
</p>
<label for="toggle">close</label>
</dialog></td></tr>
<?php }?>
</tbody>
</table>
</div>
but I keep on getting only the last value in the specific row
image:
I tried many ways to fix it but the main problem is its only getting the first value in the while loop.
Aucun commentaire:
Enregistrer un commentaire