php – Get the value that the user clicked on a PivotTable

Hello …

I have a problem for several days and I can not solve it.

The situation is as follows: I have a dynamically created table from the database data:

Search screen

When the user hovers over an option, the option is highlighted:

Search screen with the option selected

I need that when I click on a selected line, I get the value corresponding to the column Name, and can for example put this value in a variable for future treatments.

The big problem is that I do not understand how to proceed in a dynamic array, that is to say that its content varies according to the data of what is returned from the database.

Here is the code where all processes occur:

    Research Coordinator

Search results
ID Name E-mail Phone Functional category
0) { // start the loop that will display all the data make { ?>