If you'd done a search on surnames for example, you could have something like this.
$q = "SELECT id, name, surname
FROM customers
WHERE surname like '$searchvar%' ORDER BY surname";
$db->safe_query($q);
if( !$db->num_rows() ) return;
echo '<table border="1">'."\n";
while ( $row = $db->fetch_assoc() )
{
echo
'<tr>',
'<td><a href="customer-details.php?id=', $row['id'], '">', $row['name'], ' ', $row['surname'],'</a></td>',
"</tr>\n";
}
echo "</table>\n";
I use a class I wrote to encapsulate all the query results gunk, just replace with the appropriate mysql functions.