I created a query to show username and pass for all users from database. Now i need to use this show data button to show info for specific user. eg. if i click show data button for user Marko it will show me other data for Marko.I'm just totally stuck and can't figure the logic behind this. This is the code for the table i have done so far. Button Show data has name attribute 'subm'.
<?php
$query ="SELECT *FROM loginapp WHERE username='".$username."'";
$result = mysqli_query($link,$query);
if(!$username){
$query ="SELECT *FROM loginapp";
$result = mysqli_query($link,$query);
}
while($row = mysqli_fetch_array($result)){
echo "<tr><td>".$row["id_num"]."</td><td>".$row["username"]."</td><td>".$row["password"]."</td><td id='data-cell'><button id='show-button' name='subm' type='submit'><i class='fa fa-search' aria-hidden='true'></i>SHOW DATA</button></td></tr>";
if(isset($_POST['subm'])){
}
}
?>