I am building a table that helps to maintain info in a database.
Each table row represents a row in the database.
It fetches everything OK and displays it in the rows, all good so far.
But I'm stuck at the point where I want to give users the ability to edit or delete a specific row. The rows all have their own id, specified as $num. (1st row: $num = 0, 2nd row: $num = 1; etc.).
I have this piece of code for row alteration:
echo "\t<td><input name=\"edit[" . $num . "]\" type=\"submit\" value=\"Edit\"> <input name=\"del[" . $num . "]\" type=\"submit\" value=\"Delete\"></td>\n";
As you can see each button also comes with it's own edit or del id. What I want to do is to have PHP check which row was selected to edit/delete, but when the form is sumbitted, $num is no longer known, since it's not a session value, but it also shouldn't be, since it changes for every row, making it a session var would always delete the last row.
How can I properly work this out so PHP recognized which "x" in $del[x] I clicked ?