<?
$qry = $_POST['qry'];
if ($qry != ''){
include 'dbconnect.php';

$sql = $dbh->prepare("select * from contacts where fullname like '%$qry%'");
$sql->execute();


while ($row = $sql->fetch()){
echo $row[1].'   '.$row[2].'  '.$row[3].'<br/>';   	
}
}
?>

<form  method="post" class="pure-form pure-form-stacked" action ="search.php"  >
    <fieldset>
        <legend>Search</legend>
       <input type="text" name = "qry" placeholder="Username">
       <input  type="submit" name = "submit" class="pure-button pure-button-primary " value = "Search">
    </fieldset>
</form>

