用php数组创建的表。 如何使用jquery获取每个单独的值?

Ok, so I have a page that users upload docs from. I put them in a folder and then update a table to show where these docs live. Now, when I go to an edit page I query that database using PHP and echo the location of those files. I'm trying to figure out a way to delete files. I know I need to unlink, but the problem I'm having is I can't seem to figure out how to get the location of each individual file. Here is the code I'm using to get the file locations.

 <?php

                $sql = 'select trnum, trseq, trfnam, trfloc, podnum
                        from bd.bdvdocs
                        where trnum = ' . $_GET['trnum'];

                $result = db2_exec($conn, $sql);

                if ($result) {
                    while ($row = db2_fetch_array($result)) {


                       echo"<tr>";
                       echo "<td><a href='" . $row[3] . $row[0] . '/' . $row[2] . "'>$row[2]</a>        </td>";


                       echo"</tr>";
                    }
                }

                ?>

This is what I get If I add a button to the right of each link and use jquery to get var, it only comes back with the value of the first link. If I click on the second button the page bombs out.

Give the <td> a class ( echo "<td class = "whatever">... ), create a named table with tbody and stuff and by using jQuerys closest() function you should then be able to find the values:

$('#name_of_table tbody').on( 'click', 'tr', function () {
       alert($(this).closest('tr').find('.whatever').html());
});

Create table like:

<table id="name_of_table"><tbody> 

<?php

while ($row = db2_fetch_array($result)) {


                       echo"<tr>";
                       echo "<td class="whatever"><a href='" . $row[3] . $row[0] . '/' . $row[2] . "'>$row[2]</a>        </td>";


                       echo"</tr>";
                    } ?> </tbody></table>