title: Get clicked href variable from one page to another
body: <p>Greeting everyone,</p>
  
  <p>Currently i'm making a webpage that has the following functions:</p>
  
  <p>When the administrator opens the page, admin will be seeing a form filled with these information from a database:
  <a href="https://i.stack.imgur.com/RrE9l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RrE9l.png" alt="enter image description here"></a></p>
  
  <p>What this page does is that it shows how many video's each user has in the database and when the admin clicks on the desired user ID, a new page should open with the video's of that specific user ID.  The " DONE" button is to return to the main page when the admin is done deleting video's.</p>
  
  <p>Now, what I have done is that I've assigned  an href link to the userID values that is being fetched from Database. The problem is that, I have no clue how to pass the selected value/string to the next page with href. I've tried with Session, but ended up getting the last variable processed in the WHILE loop instead of getting the clicked UserID. Below follows my php code of what I've done. Can anyone give me some tips on how to pass the clicked userID from one page to another with href, or is there another way to do this?
  <strong>code=</strong> <a href="http://prntscr.com/arl097" rel="nofollow noreferrer">click here</a></p>
  
  <p>ps: As everyone can see, my php coding needs some serious improvement. But i'm still trying to improve by doing these types of exercises.</p>
  
  <pre><code>&lt;?php
  
  include_once ("includes/db_connection.php");
  $sql = "SELECT Users_UserID, count(Users_UserID) AS total FROM video GROUP     BY Users_UserID";
   $sql2="SELECT UserID, FirstName, LastName FROM users";
  $result = $connection-&gt;query($sql);
  $result2 = $connection-&gt;query($sql2);
  
  ?&gt;
  
  &lt;table width="400" border="0" cellspacing="1" cellpadding="0"&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;form name="deleteSingleVideo" method="post" action=""&gt;
                  &lt;table width="400" border="0" cellpadding="3"     cellspacing="1" bgcolor="#CCCCCC"&gt;
                      &lt;tr&gt;
                          &lt;td bgcolor="#FFFFFF"&gt;&amp;nbsp;&lt;/td&gt;
                          &lt;td colspan="4" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Delete     user video&lt;/strong&gt; &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td align="center" bgcolor="#FFFFFF"&gt;#&lt;/td&gt;
                      &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;First Name&lt;/strong&gt;&lt;/td&gt;
                      &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Last Name&lt;/strong&gt;&lt;/td&gt;
                      &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;User ID&lt;/strong&gt;&lt;/td&gt;
                      &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Amount of videos&lt;/strong&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;?php
                  session_start();
                  if ($result-&gt;num_rows &gt; 0) {
                      while (($row=$result-&gt;fetch_assoc())&amp;&amp; ($row2=$result2-&gt;fetch_assoc()) ) {
                          ?&gt;
  
                          &lt;tr&gt;
                              &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;/td&gt;
                              &lt;td bgcolor="#FFFFFF"&gt;&lt;center&gt;&lt;?php echo $row2['FirstName']; ?&gt;&lt;/center&gt;&lt;/td&gt;
                              &lt;td bgcolor="#FFFFFF"&gt;&lt;?php echo $row2['LastName']; ?&gt;&lt;/td&gt;
                              &lt;td bgcolor="#FFFFFF"&gt;&lt;center&gt;&lt;a href="DeleteVideo.php" target="_blank"&gt;&lt;?php echo $row['Users_UserID'];
                                      $_SESSION['id']=$row['id'] ?&gt;&lt;/center&gt;&lt;/td&gt;
                              &lt;td bgcolor="#FFFFFF"&gt;&lt;center&gt;&lt;?php echo $row['total'];?&gt;&lt;/a&gt;&lt;/center&gt;&lt;/td&gt;
                          &lt;/tr&gt;
  
                          &lt;?php
                      }
                  }
                  ?&gt;
  
                  &lt;tr&gt;
                          &lt;td colspan="5" align="center" bgcolor="#FFFFFF"&gt;&lt;input     name="Done" type="submit" id="Done" value="Done" &lt;/td&gt;
                      &lt;/tr&gt;
  
                      &lt;?php
  
                      $connection-&gt;close();
                      if(isset($_POST['Done'])){
  
                          header( "Location: Home.php" );
                      }
                      ?&gt;
  
                  &lt;/table&gt;
              &lt;/form&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;?php
  
  ?&gt;
  </code></pre>