Like the others have mentioned it is probably something with the JavaScript return. As I can't really say anything wrong with the PHP code its self that would cause the problem.
However, I do have some tips to make your code a little more easy on the eyes.
My first suggestion with dealing with strings is to never force yourself to escape ' or ". By switching your quote style, you can make it drastically easier to read your code and find issues caused by quotes much easier.
echo " <a href='my.php?action=show&id=".$fid."'
onclick=\"return display('".$fid."');\"/> ";
This would become:
echo ' <a href="my.php?action=show&id='.$fid.'"
onclick="return display("'.$fid.'");"> '.$link_title.'</a>;
Actually, while typing this out, I noticed you aren't getting a hyperlink because you aren't completing the anchor tag. More specifically, you are terminating it early with the / In the above example, I have added:
.$link_title.'</a>
This should fix the problem.
Second suggestion:
echo "" .$fname."</a> ";
Can just as easily be typed out as:
echo $fname.'</a> ';
Using ' instead of " for strings that don't require extra work by the server is recommended, and the leading "" is not required.
EDIT:
echo ' <a href="my.php?action=show&id='.$fid.'" onclick="return display("'.$fid.'");"> '.$fname.'</a>;
Does this work? Does it display the link?