A guy did some php/database work for me a while back. He linked the pages to a menu (which had a separate function/table). I’m a little lost on how it’s beneficial to link everything to a menu like that.
Here’s the code I’m trying to figure out:
function writeContent($page){
$parentQ = "select * from cdi_content where page=\"$page\"";//query to obtain content for this page
$parentResult = mysql_query($parentQ);//run query
$link = mysql_fetch_assoc($parentResult);//result
echo $link['content'];//write content`
}
With <?php writeContent("DDesign/index.php");?> on the index.php page he created.
From what I understand it runs through the menu function, but I’m just trying to get it to print what’s in the “content” field in the database.
First check how many number of rows are there in the query. Replace that piece if code with this.