All pastes #610981 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-07-09 18:44 UTC
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>&nbsp;</TH></TR>";
		
		while($row = mysql_fetch_array($result))
		{
			
		echo "<TR><TD>". $row['firstname'] ." ". $row['lastname'] ." ". $row['city'] ."</TD></TD></TR><br />";
		
		}
		
		echo "</TABLE>";
	}
	
?>