You have not filled the required fields. Please try again."; include "search.inc"; exit; } $sql = mysql_query("SELECT * FROM dating WHERE lastname='".$lname."'") or die(mysql_error()); $result = mysql_query($sql); if(!$result) { echo "Sorry, there were no matches for your query. Please try again."; } else { echo ""; while($row = mysql_fetch_array($result)) { echo "
"; } echo "
First namelast namecity 
". $row['firstname'] ." ". $row['lastname'] ." ". $row['city'] ."
"; } ?>