rendered paste body<?php
include 'config.php';
trim($lname);
if (!$lname)
{
echo "<FONT COLOR=FF0000>You have not filled the required fields. Please try again.</FONT>";
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 "<TABLE BORDER=1><TR><TH>First name</TH><TH>last name</TH><TH>city</TH><TH> </TH></TR>";
while($row = mysql_fetch_array($result))
{
echo "<TR><TD>". $row['firstname'] ." ". $row['lastname'] ." ". $row['city'] ."</TD></TD></TR><br />";
}
echo "</TABLE>";
}
?>