Hi all, I have written some php code to display my pages + can add parent id numbers to the row in the database - but what I can’t do is create some code to show the sub-pages directly under the parent page in a menu.
Here is the sql code:
CREATE TABLE IF NOT EXISTS `pages` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`intro` varchar(255) NOT NULL,
`entry` longtext NOT NULL,
`creation_date` datetime NOT NULL,
`parent_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
and here is the php code to display the pages:
[php]
// Make the query:
$q = “SELECT id, title, intro, DATE_FORMAT(creation_date, ‘%M %d, %Y’) FROM pages ORDER BY creation_date ASC LIMIT $start, $display”;
$r = mysqli_query ($dbc, $q); // Run the query.
// Table header.
echo ’
| Title | Intro | Edit | Delete |
| ' . stripslashes($row['title']) . ' | ' . stripslashes($row['intro']) . ' | Edit | Delete |

