<?
mysql_connect("localhost", "mmaaaco_ksecor", "hamilton");
mysql_select_db("mmaaaco_mydb");
$query = $_POST['query'];
if ($query) {
echo "You searched $query";
$result = mysql_query("select concat(firstName,' ',lastName)
as name, match(details) against('$query')
as relevance from testTable where match(details) against ('$query')");
}
if (!result) echo mysql_error();
?>
<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 {
        printf("<tr><td>%s</td><td>%s</td></tr>\n",
         $myrow["name"], $myrow["relevance"]);
      } 
      while ($myrow = mysql_fetch_array($result));
  }
  ?>
  </table>    
  
  <form action = "boolean2.php" method = "post">
  Search me <input type = "text" name = "query" /><br/>
  <input type = "submit" value = "Search" />   
  </form>
  