Código PHP:
$menu = mysql_query("SELECT * FROM cmsmenu WHERE id = 1");
$menu2 = mysql_query("SELECT * FROM cmsmenu WHERE id = 2");
$menu3 = mysql_query("SELECT * FROM cmsmenu WHERE id = 3");
$menu4 = mysql_query("SELECT * FROM cmsmenu WHERE id = 4");
$menu5 = mysql_query("SELECT * FROM cmsmenu WHERE id = 5");
$menu6 = mysql_query("SELECT * FROM cmsmenu WHERE id = 6");
$menu7 = mysql_query("SELECT * FROM cmsmenu WHERE id = 7");
$menu8 = mysql_query("SELECT * FROM cmsmenu WHERE id = 8");
$r = $connector->fetchArray($menu);
$r2 = $connector->fetchArray($menu2);
$r3 = $connector->fetchArray($menu3);
$r4 = $connector->fetchArray($menu4);
$r5 = $connector->fetchArray($menu5);
$r6 = $connector->fetchArray($menu6);
$r7 = $connector->fetchArray($menu7);
$r8 = $connector->fetchArray($menu8);
?>
<?php
echo '<a href="'.$r['link'].'">';
echo $r['name'];
echo '</a>';
?></li>
<li>
<?php
echo '<a href="'.$r2['link'].'">';
echo $r2['name'];
echo '</a>';
?>
<li><?php
echo '<a href="'.$r3['link'].'">';
echo $r3['name'];
echo '</a>';
?></li>
<li><?php
echo '<a href="'.$r4['link'].'">';
echo $r4['name'];
echo '</a>';
?></li>
<?php if(!isset($_SESSION["user"])) { ?>
<li><?php
echo '<a href="'.$r5['link'].'">';
echo $r5['name'];
echo '</a>';
?></li>
<li><?php
echo '<a href="'.$r6['link'].'">';
echo $r6['name'];
echo '</a>';
?></li>
<? } else { ?>
<li><?php
echo '<a href="'.$r7['link'].'">';
echo $r7['name'];
echo '</a>';
?></li><?
}
?>