Sampe database:
id | username | payer_id | confirmation | other_info
1 | trillzglobal | 27 | 2 | …
2 | trillzglobal | 28 | 2 | .>>>>>>>
7 | trillzglobal | 45 | 2 | >>>>>>>
now i try to write a php that select and store the id and payer_id where ever there is user “trillzglobal”
then when confirmation is 2 it should create an html button with hidden detail $id and $payer_id
For the above database, three buttons are created
Challenge: every time i click any of the buttons it has the last id=7 and payers_id = 45 stored in all of them
MY CODE IS attached and this is it
[php]
if (mysqli_num_rows($num) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($num)) {
$id = $row['id'];
$username_text = $row['username_text'];
$id_payer = $row['id_payer'] ;
if($Confirmation_No == 2){
echo"<form action='button.php' method='post'>
<input type='submit' value='CONFIRM' name='submit'>
<input type='hidden' name='id' value='$id'>
<input type='hidden' name='id' value='$id_payer'>
</form>";
}
[/php]