I'm working on a new CMS to use on repeative projects. Basically this chunk of code connects to a server, grabs all the names of the tables and uses them to generate a simple navigation. It works pretty great for what I need however I'm just wondering if maybe I can optimize this code sniplet even more and make it even more simple. Maybe making a class that could customize the formating? Etc. I tried to make this as "bare-bones" as possible.
The only thing that is there that I would like to explain is that it checks to see if the table name isn't "includes" this is a default table my CMS uses to know what data to display on the front end as far as data.
<?php
echo '<div class="dynamic_nav_head">Navigation</div>';
echo '<div class="dynamic_nav">';
include('data.php');
$tables = mysql_list_tables($database);
while (list($table) = mysql_fetch_row($tables)) {
if($table!='includes'){
echo "<div class='cat'>".ucwords($table)."</div>";
echo "<div class='cat_item'>";
echo "<a href='?page=read§ion=".$table."'>View " . ucwords($table) . "</a>";
echo "</div>";
echo "<div class='cat_item'>";
echo "<a href='?page=add§ion=".$table."'>Add New ". ucwords($table) ."</a>";
echo "</div>";
} // End If not in Includes.
} // End While
echo '</div>';
?>
Any Suggestions on how I can make this code even leaner, cleaner, and more swift? Thanks in advance!
Edit: MySQL Version: 4.1.22