<?include "conninfo.php";

$thesearch=$_POST["usersearch"];
//echo $thesearch;
?>

<h1>Database results:</h1>

<?
$query="SELECT * FROM people WHERE firstname like '$thesearch'";
$result=mysqli_query($link,$query)or die("Didnt work");

$numberfound=mysqli_num_rows($result);//find number of rows
if($numberfound==0)
{
echo "Sorry nothing found";
}
else
{
	while($r=mysqli_fetch_array($result))
	{
	echo $r["id"];
	echo " ";
	echo "<i>".$r["firstname"]."</i>";
	echo " ";
	echo $r["surname"];
	echo " <b>";
	echo $r["favfood"];
	echo "</b> ";
	echo $r["starsign"];
	echo "<br>";
	}
}