Yes, Sorry about that but I was trying not to change your script all that much so I forgot the while. Here is what you need.
$sql = "SELECT * FROM deals WHERE lastname LIKE '".$lastname."'";
$result = mysql_query($sql);
while($myrow = mysql_fetch_array($result)) {
$id = $myrow["id"];
$saleprice = $myrow["saleprice"];
$rebate = $myrow["rebate"];
$tradevalue = $myrow["tradevalue"];
$tradepayoff = $myrow["tradepayoff"];
$cashdown = $myrow["cashdown"];
$msrp = $myrow["msrp"];
$residual = $myrow["residual"];
$firstname = $myrow["firstname"];
$lastname_b = $myrow["lastname"];
$beacon = $myrow["beacon"];
echo "<tr><td>$firstname</td><td>$lastname_b</td></tr>";
}
You don't have to change the $lastname that is used in the if statement, just the one that sets as $myrow["lastname"], understand?