title: PHP reservation system passing specific while loop results to next php page
body: <p>Making a car rental reservation system for a school project, project is in html/php &amp; SQL. So far the user picks location date/time and car category on page 1, user then searches available cars on page 2. on page 2 the cars are listed and user picks the car they want to rent, the cars are listed in while loop from 
  the database. there is a reserve button attached to each car so that the user can pick. </p>
  
  <p>Heres my issue how do i pass over the cars details as variables(make, model, class, dailyrate) for what the user picks onto the next php page prompting page. im using $_sessions. </p>
  
  <pre><code>    &lt;?php 
  
      $sql= "SELECT * FROM vehicles WHERE class='$class'";
      $result = mysqli_query($db,$sql);
      $resultCheck = mysqli_num_rows($result);
          if ($resultCheck &gt; 0) {
               while ($row = mysqli_fetch_assoc($result)) {   //beginning of while loop
  
                  $_SESSION['make']=$row['make'];
                  $_SESSION['model']=$row['model'];
                  $_SESSION['class']=$row['class']; 
                  $_SESSION['dailyrate']=$row['daily_rate'];
  
               ?&gt;
  
                  &lt;div class="card"&gt;
                     &lt;div class="img"&gt;
                      &lt;img src='../../images/defaultcar.png' width='100' height='100'&gt;
                     &lt;/div&gt;
                     &lt;div&gt;
                          Make: &lt;?php  echo $row['make']; ?&gt;&lt;br&gt;
                          Model: &lt;?php echo $row['model']; ?&gt;&lt;br&gt;
                          &lt;b&gt;Class: &lt;?php echo $row['class']; ?&gt;&lt;/b&gt;&lt;br&gt;
                         &lt;div class="price"&gt; &lt;b&gt;$ &lt;?php echo $row['daily_rate']; ?&gt;&lt;/b&gt;/Per day&lt;/div&gt;
                     &lt;/div&gt;
  
                  &lt;a href="booking-payment.php"&gt;&lt;button class='reserve-btn'&gt;Reserve&lt;/button&gt;&lt;/a&gt;
  
                  &lt;/div&gt;;
  
               &lt;?php  } //ending bracket of while loop
          }
          else { 
                  echo "0 results"; 
               }
      ?&gt;      
  &lt;/div&gt;
  </code></pre>