'How to delete a row from SQL table using button

I am trying to write a function using php and javascript to delete a row from sql database when a button is clicked in that row. This is my table, so once you click the button in a specific row, it would remove said row using the login_id, but I can't really find a way to get this done.

                        '<td>' . $row['login_id'] . '</td>' .
                        '<td>' . $row['first_name'] . '</td>' .
                        '<td>' . $row['last_name'] . '</td>' .
                        '<td>' . $row['email'] . '</td>' .
                        '<td>' . $row['password'] . '</td>' .
                        '<td>' . $row['is_banned'] . '</td>' .                    
                        '<td>  <button type="button" name="deletebutton" onclick="deletefunction()">Delete</button>  </td>' .
                     '<tr>';

this is what the table looks like



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source