Mega Code Archive
Website Navigation via PHP
";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
extract($line);
if ($lastcategory != $link_type)
{
if ($lastcategory)
print "
\n";
if ($link_type != "Navigation")
print "$link_type: ";
else
print " ";
$lastcategory = $link_type;
}
if ($link_caption != "")
{
print " [ ";
for ($i = (15 - strlen($link_caption)) / 2; $i > 0; $i = $i - 1)
{
print " ";
}
print "";
for ($i = (15 - strlen($link_caption)) / 2; $i > 0; $i = $i - 1)
{
print " ";
}
if ((15-strlen($link_caption)) % 2 == 0)
print " ";
}
else
{
print " [ ";
print "";
}
print " ]";
}
print "
\n";
mysql_free_result($result);
mysql_close($conn);
}
?>
#MySQL syntax to create internal_links table:
CREATE TABLE internal_links (
_handle INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
link_caption TEXT,
link_location TEXT NOT NULL,
link_type ENUM("Business", "Personal", "Projects", "Scholastic", "Navigation")
);