I am a beginner developer and very new to php.

I am writing a php script for a webpage that displays the contents of a database in a table using a loop to build the table. Displaying the contents is not the problem, what I need to be able to do is have buttons for editing and deleting the coresponding row of the database on each row of the display table. So far my code builds the table and the buttons fine but I have know idea how I add the functionality to the buttons! for the edit button I need it to bring the user and the contents of that row to another page (already created) for editing, and the delete button just has to delete that row from the database. heres the code:

```
while ($row = mysqli_fetch_array($result))
{

    echo "<tr>
          <td><select multiple class='form-control'><option>" . $row[3] . "</option></select></td>
          <td><center>" . $row[1] . "</center></td>
          <td><center>" . $row[7] . "</center></td>
          <td><center><img style='display:block; width:100px;height:100px;' alt='' src='data:image/jpeg;base64," . $row[8] . "'/></center></td>
          <td><center><button type='button' class='btn btn-success'>Edit</button></center></center>&nbsp;</td>
          <td><center><button type='button' class='btn btn-danger'>Delete</button></center></td>
          </tr>";

}

```

I do not know how I will relate each button that gets built by the loop with the row that it is located on. Can anyone shine a light on this problem? Am I approaching this wrong maybe?

Thank you for any input!