As interactive says, PHP is server-side.
If you're deleting a row from the database, Javascript won't work, 'cos that's client-side.
What you could do is wrap the whole table in a form. Then, for your button on each row, use
<input type="submit" name="killrow$i" value="Delete this row">
where $i is the number of that particular row.
Then when you process the form, look to see which of the "killrow$i" variables is set, and that will tell you which row to delete.
Alternatively, instead of a form submit, use a link instead of a button, and then have $i in the URL. To the processing script it will look like a form GET.
One could have a form on each row, and add a hidden field in which to store $i, and then the submit buttons can all have the same name, but that breaks the HTML spec (tables contain either thead, tbody, or tr elements, not form elements).