function printconstantlinks()
{
// Variables:
$lastcategory = FALSE; // The last link category seen. Cheat a bit here to say if we've seen a link category yet.
$serverlocation = "localhost";
$username = "mywebsiteusername";
$password = "mywebsiteuserpassword";
$db_name = "mywebsitedatabase";
// Now we want to display all the links we want on every page,
// Get a connection to the database first.
$conn = mysql_connect($serverlocation, $username, $password)
or die("Could Not Connect To Server");
mysql_select_db($db_name) or die("Could not use database for website");
// Now, we want to order our links by their category, and then their caption.
$query = "SELECT link_type, link_caption, link_location FROM internal_links ORDER BY link_type, link_caption";
$result = mysql_query($query) or die("Query failed.");
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")
);