title: Make a search result a button; so that when clicked retrieves more information about the clicked item
body: <p>The following code is a basic search engine of my database. The user enters a description and it returns a pupil id, pupil forename and surname accordingly. I know wish to make the value of '$id' (which represents a pupil id) a link/button that when clicked will retrieve from the database more specific information about the projects that individual pupil has completed.</p>
  
  <p>Thank you for your time. Any help will be greatly appreciated.</p>
  
  <pre><code>{if(isset ($_POST ['search'])){
      $searchq = $_POST['search'];
      $searchq= preg_replace("#[^0-9a-z]#i","",$searchq);
  
      $query = mysql_query("SELECT * FROM pupil WHERE pupil_forename LIKE '%$searchq%' OR pupil_surname     LIKE '%$searchq%' OR pupil_id LIKE '%$searchq'") or die("Could not search");
      $count = mysql_num_rows($query);
  
      if ($count == 0 ) {
          $output = "No Pupils fit that description. Try again or add new Pupil details &lt;a href='pupilinput.php'&gt;here.&lt;/a&gt;";     
      } else{
          while($row = mysql_fetch_array($query)){
              $fname = $row['pupil_forename'];
              $sname = $row['pupil_surname'];
              $id = $row['pupil_id'];
  
              $output .= '&lt;div&gt; &lt;b&gt;ID:&lt;/b&gt; '.$id.' &lt;b&gt;Name:&lt;/b&gt; '.$fname.' '.$sname.'&lt;/div&gt;&lt;br&gt;';
          }
      }
  }}
  </code></pre>