Thanks, but no luck :-(
I changed the code to
$sql = "select d.id from dt_profile d, minibb_posts m where m.poster_id = d.id and m.poster_id ='$poster_id'";
$viewReg="<a href=\"../../index.php?page=view_profile&id={$query}\">$ins</a>";
At this point it shows a profile but it's always my own profile instead of the posters profile