So, the complete code I need to add after the second link, is:
PHP Code:
$query = "SELECT * FROM users WHERE username = '".$username."'";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
$id=@mysql_result($result,$i,"uid");
if($username != ""){
$link3 = "<li><a href='viewprofile.php?id=".$username."'>My Account<span class='tab-l'></span><span class='tab-r'></span></a></li>";
}
Cheers!