well I think what you want to do is called using data across pages.
You have some data on one page, I guess a list of account numbers.
And then after clicking on one, on the next page you want to look up the account number and show the info.
In order for that to happen you need to get the (at least) the account number from page one to page two.
You can do this in thre ways: GET method, POST method, and using sessions. Sessions is very complicated. You could use POST but it requires using a form.
GET is the easiest.
Get passes variables from page to page by using the URL. It adds a ? and then a variable name, equals, and then a value. You can have many variables by separating them with a &.
On the second page, if the URL is display.php?acc=123 we know, and more importantly PHP knows that the variable (depending on register_globals) $acc is equal to 123. We can use $acc simply like
<? echo $acc; ?> or like <? echo $_GET['acc'];?>
or:
<? echo $HTTP_GET_VARS['acc']; ?>
Depending on your settings, one or all of these will print 123 on the page.
From your post I will assume you already know how to get the desired information from a database.
Once you have the information you wan, you can build a URL:
$myurl = "<a href='display.php?acc=" . $value . "'>Click Here to see your details</a><br>";
if you put that in a loop and output them as you go, you will have links to the display page with the variable added onto the end.
Then in the page display.php you will be able to access acc one of the ways I showed you.
You can use it to look into your database again and get the information you want.