title: How can i select the right row?
body: <p>Page 1 :</p>
  
  <pre><code>&lt;div&gt;
  &lt;?php
          $reponse = $db-&gt;query('SELECT * FROM societe;');
  
  ?&gt;
  
      &lt;table border=1&gt;
          &lt;form method="post" action="ModifSociete.php"&gt;
      &lt;?php
          $increm = 1;
          while($donne = $reponse-&gt;fetch()){
      ?&gt;
              &lt;input type="hidden" value="&lt;?php echo $donne['NomSoc']; ?&gt;" name="nomSoc&lt;?php echo $increm; ?&gt;"/&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;?php echo $donne['ID']; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo 'Societe '.$donne['NomSoc']; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $donne['Lieu']; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $donne['Mail']; ?&gt;&lt;/td&gt;
                  &lt;input type="hidden" value="&lt;?php echo $donne['ID']; ?&gt;" name="getIdSoc&lt;?php echo $increm; ?&gt;"/&gt;
                  &lt;td&gt;&lt;input class="btn" type="submit" value="Modifier"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
  
      &lt;?php
          $increm++;
          }
          $reponse-&gt;closeCursor(); 
  
      ?&gt;
              &lt;input type="hidden" value="&lt;?php echo $increm; ?&gt;" name="nbIncrem"/&gt;
          &lt;/form&gt;
      &lt;/table&gt;&lt;br/&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p></p>
  
  <p>Page 2 :</p>
  
  <pre><code>&lt;form method="post" action="UpdateSociete.php"&gt;
  &lt;?php
  //WHERE ID = "'.$_POST['getIdSoc'.$i.''].'"
      $getNomSoc = $db-&gt;query('SELECT * FROM societe;');
  
      $thisSociete =array();
      $i=0;
      while($data = $getNomSoc-&gt;fetch()){
  
          $thisSociete[$i]["NomSoc"] = $data['NomSoc'];
          $thisSociete[$i]["Lieu"] = $data['Lieu'];
          $thisSociete[$i]["Mail"] = $data['Mail'];
          $thisSociete[$i]["ID"] = $data['ID'];
          $i++;               
      }
      $j=1;
  
          $thisSocieteNom = "";
          $thisSocieteLieu = "";
          $thisSocieteMail = "";
          if($_POST['nomSoc'.$j.''] == $thisSociete[$j-1]["NomSoc"]){
              var_dump($_POST['nomSoc'.$j.'']);
              var_dump($thisSociete[$j-1]["NomSoc"]);
  
              $thisSocieteNom = $thisSociete[$j-1]["NomSoc"];
              $thisSocieteLieu = $thisSociete[$j-1]["Lieu"];
              $thisSocieteMail = $thisSociete[$j-1]["Mail"];
  ?&gt;
              &lt;input type="hidden" value="&lt;?php echo $thisSociete[$j-1]["ID"]; ?&gt;" name="getIdSocBis"/&gt;
  &lt;?php
          }
          else{
              $j++;
          }
  
  ?&gt;
  &lt;input type="hidden" value="kangourou" name="passwordAdmin" /&gt;
  &lt;div&gt;
      &lt;h4&gt;Modifier la societe &lt;?php //get le nom de la soiete ?&gt; :&lt;/h4&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;label&gt;Nom : &lt;/label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" name="ajoutNomSoc" value="&lt;?php echo $thisSocieteNom; ?&gt;"&gt;&lt;/input&gt;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;label&gt;Lieu : &lt;/label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" name="ajoutLieu" value="&lt;?php echo $thisSocieteLieu; ?&gt;"&gt;&lt;/input&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;label&gt;Mail : &lt;/label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" name="ajoutMail" value="&lt;?php echo $thisSocieteMail; ?&gt;"&gt;&lt;/input&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
  &lt;/div&gt;
  &lt;input type="submit" value="Enregistrer"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>My page 2 is used to update the information in the table from the first pages.</p>
  
  <p>My problem is that i dont know how to select the row i want to update.
  With my code i always update the first but i dont know what i have to change to select the row i want.</p>
  
  <p>What I want :
  My table has 4 column. The last one is the submit button. When i click on one of them I go on my second pages (where i can see the information od the row in the text input) and i can change the information of my row (the one where i clicked on the submit button).</p>
  
  <p>How can i do that ?</p>
  
  <p>P.S. : I tried to be the clearest i could...</p>