The problem I have is the following.
I have this part of the code with which I show games in the database:
$catalogo = mostrarCatalogo();
while($row2 = mysqli_fetch_assoc($catalogo)){
echo'
<div class="producto">
<img src="images/'.$row2["idJuegos"].'.jpg" alt="proyecto2">
<button class="btn btn-outline-secondary boton-lotengo">LO TENGO</button>
</div>
';
}
The problem is that I do not know how to get the value of $ row2 and pass it to another method, without putting a return and remove it from the loop.
Update: I want that when I click on the button I have it, I take the id of the game that at that moment comes out through the while and can pass it to another function to insert