Hello
I use that exact method on my website.
Here is how i do it.
This is the script which grabs the contens of the page from a mysql database
<?php
$page = $_REQUEST['p']; /// this gets the page name e.g index.php?p=contact
if (!$page)
{
include ('main.php');///This includes a file containing the homepage content
}
else
{
MYSQL_CONNECT("localhost","$mysql_u","$mysql_p");
mysql_select_db("$mysql_db");
$query = "SELECT data FROM data WHERE name = \"$page\" ";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
$p = stripslashes($row['0']);
echo "$p" ;
}
?>
This is a script for the menu..
<?php
include ('../www/config.php');
MYSQL_CONNECT("localhost","$mysql_u","$mysql_p");
mysql_select_db("$mysql_db");
$query = "SELECT name, menu FROM data WHERE show_menu = 'yes'";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result))
{
$menu = "<a href=\"index.php?p={$row['name']}\">{$row['menu']}</a><br>" ;
echo ($menu);
////////////////////
}
MYSQL_CLOSE();
?>
hope this helps