Hey all, I've created a back end where customers can edit their content. The page content (just text) is currently in a table, which includes the meta tags and page name. I have been using the following code to get the specific content on each page using WHERE id = 1,2,3 etc

PHP Code:
mysql_select_db($database_template$template);
$query_pages "SELECT * FROM pages WHERE id = 1";
$pages mysql_query($query_pages$template) or die(mysql_error());
$row_pages mysql_fetch_assoc($pages);
$totalRows_pages mysql_num_rows($pages); 
I now want to pull the page name from individual records so I can insert it into the navigation buttons. This way, if they change the page name from the back end, it will be reflected in the navigation buttons on every page. I don't want to use a while loop in the nav as some of the buttons are unique, like the active one has different properties and an arrow. What is the best way to pull individual bits of information from a table, so <?php echo $row_pages['pagename']; ?> where ID = 2. <?php echo $row_pages['pagename']; ?> where ID = 3 etc. I could duplicate the above 10 times on each page purely to get the page name but I guess there's a better way? Thanks in advance