I`am trying to get the $row['username'] every time I click on the button, for me to use it in the query . But only the first array is displayed. I want to use jquery but I have small knowledge on it.
<?php
$query = $con->query("SELECT * FROM account WHERE acc = 'agency'");
while($row = mysqli_fetch_array($query))
{
echo $row['username'];
?>
<button data-target="#select" data-toggle="modal">Select</button>
<?php } ?>
<div class="modal" id="select">
<?php
$query = $con->query("SELECT * FROM sample WHERE username = ".$row['username']."");
?>