title: Getting data from a row in HTML 5 table
body: <p>I have a two dimensional array in php that I iterate through and return each element as a row in a HTML table - with the last column in the table being a button.</p>
  
  <p>When the button is clicked, I need to store the details of that particular row in seperate variables, but struggling to get anything to work.</p>
  
  <p>Any help appreciated !</p>
  
  <pre><code>for($i=0; $i &lt; $arrayLength; $i++)
         {
              echo "&lt;tr&gt;";
                      echo "&lt;td&gt;".$resultsArray[$i][0]."&lt;/td&gt;"; //NAME
                      echo "&lt;td&gt;" . $resultsArray[$i][1] . "&lt;/td&gt;"; //LOCATION 
                      echo "&lt;td&gt;" . $resultsArray[$i][2] ."&lt;/td&gt;"; // DISTRICT
                      echo "&lt;td&gt;" ."approx ".$resultsArray[$i][3]  . " miles" ."&lt;/td&gt;"; // DISTANCE               
                      echo "&lt;td&gt;" . "#".$resultsArray[$i][5]. "&lt;/td&gt;"; //REFERENCE NUMBER
                      echo "&lt;td&gt;". "&lt;button&gt;"."Get Details"."&lt;/button&gt;"."&lt;td&gt;"; // BUTTON
              echo "&lt;/tr&gt;";               
          }
  </code></pre>