Aha - I see - you want to pass variables to the PHP file that accesses the DB. Correct? OK:
Do your link like this:
<a href="./myfile.php?usierid=123456">
In the file myfile.php, you need to pick up the user ID thus:
<?php
$new_userid=$_GET['$userid'];
?>
Does this answer your question, or am I still completely off-track?
Norman