<?include "conninfo.php";

$sn=$_POST["sname"];

$query="SELECT * FROM people WHERE surname like '$sn%'";

$result=mysqli_query($link,$query);

$numrows=mysqli_num_rows($result);//how many rows?

if($numrows==0)
{
	echo "Sorry nothing found";
}
else
{
	while($r=mysqli_fetch_array($result))
	{
	echo $r["id"]." ";
	echo $r["firstname"]." ";
	echo $r["surname"]." ";
	echo $r["postcode"]."<br>";
	}
}






?>