Say you have links like these looped from your DB:
echo "<li><a href="profiles.php?id={$row['id']}">{$row['username']}</a></li>";
The receiving page then picks up the id and displays the data accordingly.
if(isset($_GET['id')){
...do your stuff here...
}