
<?
$post = $_POST['search'];
if ($post != "")
   {
echo "YOu searched for $post<br/>";   
$db = mysql_connect("localhost", "mmaaaco_ksecor", "hamilton");
mysql_select_db("mmaaaco_ksecor",$db);
$result = mysql_query("select concat(firstName,' ',lastName) 
as name, details,
match (details) against('$post') as relevance
from testTable where
match (details) against('$post')",$db);
echo mysql_num_rows($result)." Results"; 
   }
?>
<table>
	<tr><td colspan="4"><a name="top"><h3>Student Practice Queries</h3></a>
</td>
	</tr>
	<tr>
	<th align="left">Name</th>
	<th align="left">Relevance</th></tr>
 <? 
 // display list if there are records to display. The %s is a placeholder for each field you select below
 	if ($myrow = @mysql_fetch_array($result)) {

      

      do {

 echo  "$myrow[name],$myrow[relevance] $myrow[details]<br/><br/>";

      } 
      while ($myrow = mysql_fetch_array($result));
  }
  ?>
  </table>    
    <form action = "relevance.php" method = "post">
  Search<br/>
  <input type = "text" name = "search" />  
  <input type = "submit" name = "submit" value = "search"/>
  </form> 