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 ""; for($i=0; $i < $num_result; $i++) { $row = mysql_fetch_assoc($result); echo "
"; } echo "
First namelast namecity 
". $row['firstname'] = $row[0] ." ". $row['lastname'] ." ". $row['city'] ."
"; } ?>