you are absolutely correct. generate the link with PHP and pass it the ID variable. As far as popping up a new window, you'll have to use JavaScript to acheive that. This is a simple JS function that will do it:
<HEAD>
<SCRIPT LANGUAGE="JavaScript1.2">
function openWindow(theURL,winName,features)
{
window.open(theURL,winName,features);
}
</SCRIPT>
</HEAD>
then when you do the link, do something like:
<a href=\"#\" onMouseDown=\"openWindow('scriptName.php?recordId=$id','WindowName','scrollbars=yes,width=500')\">
[text_that_you_show_for_each_link] </a>
the window you pop up(scriptName.php) should use the $id in a mySql query to get the info you desire.
AS a side note, I really like to use a JS called OVERLIB. This is the coolest javascript I've seen for displaying a lot of info on one page. On a mousover, it pops up a little box (that goes away on MouseOut) and you can fill that box with HTML and thus your results from the mySql query... this takes a bit more tinkering to make it work, but have a look if you want, it can be found at:
http://www.javascriptsource.com/messages/overlib.html
cheers
marty