<?include "conninfo.php";  //make connection to db available;

$thesearch=$_POST["search"];//get data from form


$query="SELECT * FROM people WHERE surname like '$thesearch%'";//set up the query;
$result=mysqli_query($link,$query)or die("Failed to do query");

$numrows=mysqli_num_rows($result);//check how many found
if($numrows==0)				//if nothing found, print a message
	{
	echo "Sorry nothing found";
	}

while($r=mysqli_fetch_array($result))		//get row
{
echo $r["id"];
echo " ";
echo $r["firstname"];
echo " ";
echo $r["surname"];
echo " ";
echo $r["dateofbirth"];
echo " ";
echo $r["starsign"];
echo "<br>";
}


?>