title: How to get Data from HTML Table
body: <p>I am developing a project in which I have an admin and users so in the admin panel I have a table in which all videos and All User are listed With checkBox. </p>
  
  <p>In the table, I have Two columns Videos and Users. In videos column, all videos are listed and in the Users column, there is another table called Select User where all users are listed with a checkbox for each video.</p>
  
  <p>So the problem is when admin selects the user's checkbox I want to know for which video he selects the users so that specific video only appear to selected users in the user panel.</p>
  
  <p>image link for user table 
  link: <a href="https://ibb.co/t25kppy" rel="nofollow noreferrer">https://ibb.co/t25kppy</a></p>
  
  <p>I hope you all understand my problem </p>
  
  <p>I am able to the selected user's name from checkbox but don't know how to get the video for which the users are selected  </p>
  
  <pre><code>&lt;?php
  require_once 'Header.php';
  require_once 'Includes/DB.php';
  $query = 'SELECT * FROM `videos`;';
  $query2 = 'SELECT `FullName` FROM `users`;';
  $result = mysqli_query($conn, $query);
  $result2 = mysqli_query($conn, $query2);
  $checkResult = mysqli_num_rows($result);
  $checkResult2 = mysqli_num_rows($result2);
  while ($row2 = mysqli_fetch_assoc($result2)) {
      $data[] = $row2['FullName'];
  
  ?&gt;
  
  
  
  &lt;main&gt;
  &lt;div class="container"&gt;
  
        &lt;table class="table"&gt;
          &lt;thead&gt;
          &lt;tr&gt;
              &lt;th scope="col"&gt;&lt;h4 align="center"&gt;Videos&lt;/h4&gt;&lt;/th&gt;
              &lt;th scope="col"&gt;&lt;h4 align="center"&gt;Users&lt;/h4&gt;&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          &lt;?php
          if ($checkResult &gt; 0 &amp;&amp; $checkResult2 &gt; 0)
          {
              while ($row = mysqli_fetch_assoc($result))
              {
                     echo '
                    &lt;tr&gt;
                    &lt;form action="Select_Users.php" method="post"&gt;
                    &lt;td align="center" scope="row"&gt; &lt;iframe width="200" height="200" src="https://www.youtube.com/embed/' . $row['youtube_video_id'] . '"frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;
                    &lt;/td&gt;
                    &lt;td&gt;
                      &lt;table class="table"&gt;
                          &lt;thead&gt;
                            &lt;th scope="col"&gt;&lt;h4 align="left"&gt;Select Users&lt;/h4&gt;&lt;/th&gt;
                          &lt;/thead&gt;
                          &lt;tbody&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;';
                                      for ($i = 0; $i &lt; count($data); $i++)
                                      {
                                          echo '&lt;div&gt;&lt;label&gt;&lt;input type="checkbox" name="selectedUsers[]" value="' . $data[$i] . ' "&gt;' . $data[$i] . '&lt;/label&gt;&lt;/div&gt; &lt;br&gt;&lt;br&gt;';
                                      }
                                          echo'
                                      &lt;button type="submit" name="Submit"&gt; Submit&lt;/button&gt;
                                  &lt;/td&gt;
                    &lt;/form&gt;
                              &lt;/tr&gt;
                          &lt;/tbody&gt;
                      &lt;/table&gt;
                    &lt;/td&gt;';
              }
          }
          else
          {
              echo 'no result fount in database';
          }
          ?&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  &lt;?php
  if (isset($_POST['Submit']))
  {
      if (!empty($_POST['selectedUsers']))
      {
          foreach ($_POST['selectedUsers'] as $selectedUsers)
          {
              echo '&lt;h1&gt;'.$row['youtube_video_id'].'&lt;/h1&gt;';
              echo '&lt;h1&gt;'.$selectedUsers.'&lt;/h1&gt;';
          }
      }
      else
      {
          echo '&lt;h1&gt;No value found&lt;/h1&gt;' ;
      }
  }
  ?&gt;
  </code></pre>
  
  <p></p>