Hi there
I am new to PHP programming and am hoping someone can point me in the right direction - not really looking to get a packaged answer, just a shove in the right direction.
My problem :
I have a pet project of building a CMS system using PHP, MySQL and one of the free WYSIWYG editors.
Maybe I am starting in the wrong place but I wanted to get the front end working fine prior to attacking the back end.
I am using as my basis for building the site and cannot figure out how to extract the data from the database to build the 2 level (needs to be 'n' level really) site navigation
My table structure is (truncated for simplicity):
Field
=====
Id Primary Key, auto increment
Name Name of Page
ParentId The parent Id the page is linked to
I have a "God" entry in the table (with an Id of 1) so that the first level navigation items all have the ParentId value of 1. Then any sub items point back to the relative table entry.
So to write a function, etc to dynamically build this is where I am stuck.
I thought about a resursive type function, then maybe using multi demensional arrays.
Help please, my head is spinning . . .
Thanks
Nigel Wilson
Christchurch Web Design
I am new to PHP programming and am hoping someone can point me in the right direction - not really looking to get a packaged answer, just a shove in the right direction.
My problem :
I have a pet project of building a CMS system using PHP, MySQL and one of the free WYSIWYG editors.
Maybe I am starting in the wrong place but I wanted to get the front end working fine prior to attacking the back end.
I am using as my basis for building the site and cannot figure out how to extract the data from the database to build the 2 level (needs to be 'n' level really) site navigation
My table structure is (truncated for simplicity):
Field
=====
Id Primary Key, auto increment
Name Name of Page
ParentId The parent Id the page is linked to
I have a "God" entry in the table (with an Id of 1) so that the first level navigation items all have the ParentId value of 1. Then any sub items point back to the relative table entry.
So to write a function, etc to dynamically build this is where I am stuck.
I thought about a resursive type function, then maybe using multi demensional arrays.
Help please, my head is spinning . . .
Thanks
Nigel Wilson
Christchurch Web Design