Thought I'd seen that on here somewhere. Done it but it still shows the link even if not logged in.
This is the code for my link.
if ((isset($_SESSION['username'])) and ($_SESSION['username'] != ''))
echo "<li><a href='../members.php' rel='ddsubmenu3'>My Account</a></li>";