For example I have this code here
$query = $con->query("SELECT * FROM acc");
while($row = mysqli_fetch_array($query))
{
echo $row['username'];
<button data-target="#click" data-toggle="modal">Click this array</button>
}
include_once 'modal.php';
//This is the modal php file
<div class="modal" id="click">
//for example I want to get the value of the current ($row['username']) that I clicked and then use it in the new query.
$newQuery = $con->query("SELECT * FROM client WHERE username = ".$row['username']."");
</div>
How do you get the array value that is clicked by the button into the next page or in modal? Should I use javascript or something?
Aucun commentaire:
Enregistrer un commentaire