Whey you echo the account number, you can apply an url:
You may echo the account number like this:
echo '<td>'. $row["account_number"] .'</td>';
Embed the account number into an url.
echo '<td><a href="detailspage.php?an='.$row["account_number"].'"> '.$row["account_number"].'</a></td>';
in detailspage.php you can get the number with $_GET["an"] .