title: PHP pass variable from while loop to Select query on another page
body: <p>I have page named <code>prototype.php</code>  and there is a while loop where I echo buttons. And when you click that button you are redirected to <code>"proto.php?id=".$row['id']</code> And on that page a table needs to be shown with the content that contains the rows that have the id of the button. But I don't know how to pass the variable from <code>prototype.php</code> to <code>"proto.php?id=".$row['id']</code></p>
  
  <p>This is my while loop:</p>
  
  <pre><code>    &lt;?php
      $sql = "SELECT * FROM theme";
      $result = $con-&gt;query($sql);
  
      if ($result-&gt;num_rows &gt; 0) {
          // output data of each row
          while($row = $result-&gt;fetch_assoc()) {
             $your_url= "proto.php?id=".$row['id'];
              echo '&lt;a href="'.$your_url.'"&gt;&lt;input type="button" value="'. $row["theme_name"].'"&gt;&lt;/a&gt;';
  
          }
      } else {
          echo "no results";
      }
  ?&gt;
  </code></pre>
  
  <p>And this is <code>"proto.php?id=".$row['id']</code>:</p>
  
  <pre><code>$row = $_GET['id'];
  // Attempt select query execution
  $sql = "SELECT * FROM Norm LEFT JOIN Org ON norm.org_id = org.id  LEFT JOIN Cluster ON norm.cluster_id = cluster.id LEFT JOIN Orden ON norm.orden_id = orden.id LEFT JOIN Users ON norm.user_id = users.id WHERE theme_id = $_GET['id']";
      if ($result = mysqli_query($link, $sql)) {
          if (mysqli_num_rows($result) &gt; 0) {
  
              echo "&lt;table&gt;";
              echo "&lt;tr&gt;";
              echo"&lt;th&gt;Norm Org&lt;/th&gt;";
              echo "&lt;th&gt;Norm id&lt;/th&gt;";
              echo "&lt;th&gt;Norm&lt;/th&gt;";
              echo "&lt;th&gt;Ordenen&lt;/th&gt;";
              echo "&lt;th&gt;Clusteren&lt;/th&gt;";
              echo "&lt;th&gt;Verantwoordelijke&lt;/th&gt;";
              echo "&lt;/tr&gt;";
  
              while ($row = mysqli_fetch_array($result)) {
                  if ($row['orden_name']) {
                      $data_list = $row['orden_name'];
                  } else {
                    $data_list = $dropdown_list;
                  }
                   if ($row['cluster_name']) {
                      $data_list2 = $row['cluster_name'];
                  } else {
                    $data_list2 = $dropdown_list2;
                  }
                   if ($row['user_name']) {
                      $data_list3 = $row['user_name'];
                  } else {
                    $data_list3 = $dropdown_list3;
                  }
                  echo "&lt;tr&gt;";
                  echo "&lt;td&gt;" . $row['org_name'] . "&lt;/td&gt;";
                  echo "&lt;td class='row_count'&gt;" . $row['norm_id'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['norm_name'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $data_list . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $data_list2 . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $data_list3 . "&lt;/td&gt;";
                  echo "&lt;/tr&gt;";
  
              }
              echo "&lt;/table&gt;";
              // Free result set
              mysqli_free_result($result); 
            }else{
              echo "No records were found.";
          }
  
      } else {
          echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
      }
  </code></pre>
  
  <p>Can someone help me out?</p>