title: How to select a specific row from a table to edit or delete
body: <p>I have implemented a booking system, part of the system  involves allowing users to modify or delete a booking. I am able to retrieve bookings from the database based on user's session and id which is displayed in a html table. I have been having trouble selecting a specific row from the html table to edit or delete a booking. I want to be able to select a specific row from the html table which i will then be able to edit or delete that record. </p>
  
  <p>The code below retrieves the bookings and displays it in a table </p>
  
  <p><strong>bookings.php</strong></p>
  
  <blockquote>
  <pre><code>$sqlquery = "SELECT * FROM bookings1,users WHERE bookings1.userid = 
  users.userid  AND  users.username = '".$_SESSION['loggedInUser']."' ";  
  </code></pre>
  </blockquote>
  
  <pre><code>  $results = $mysqli-&gt;query($sqlquery);
  
  if ($results-&gt;num_rows &gt; 0) {
  while ($row = $results-&gt;fetch_assoc()){
  
  echo'&lt;form method = "POST" action = "editmot.php" &gt;';
  
   echo'&lt;tr&gt;';
  
    echo "&lt;td&gt;". $row["booking_id"]. "&lt;/td&gt;";
  
     echo "&lt;td&gt;". $row["Type"]. "&lt;/td&gt;";
  
       echo "&lt;td&gt;". $row["BookingDate"]. "&lt;/td&gt;";
  
        echo "&lt;td&gt;". $row["Timeslot"]. "&lt;/td&gt;";
  
          echo "&lt;td&gt;". $row["Manufacture"]. "&lt;/td&gt;";
  
             echo "&lt;td&gt;". $row["Model"]. "&lt;/td&gt;";
  
              echo "&lt;td&gt;". $row["RegistrationNo"]. "&lt;/td&gt;";
  
             echo "&lt;td&gt;&lt;a href = 'editmot.php' id ='".$row['booking_id']."'&gt; Edit &lt;/td&gt;";
  
         echo "&lt;td&gt;&lt;a href = 'delete.php' id = '".$row['booking_id']."'&gt; Remove &lt;/td&gt;";
  
        echo '&lt;/tr&gt;';
  
           echo '&lt;/form&gt;';
  </code></pre>