I’m building a site where the admin should be able to create menu items from content, like pages, forums etc:
CREATE TABLE pages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
slug TEXT,
title TEXT,
content TEXT,
parent INTEGER,
created TEXT DEFAULT '0000-00-00 00:00:00',
updated TEXT DEFAULT '0000-00-00 00:00:00',
UNIQUE(slug)
);
as well as custom links…
How should I store these menus inside the database?
You will want to create a separate table for menu items and links. For example, your end queries may look like this (partly using CI framework):
This will allow your link list (or menu items) to populate based upon the user that added them. You can, of course, constrain them upon anything in your WHERE clause, but keeping them in a separate table allows for (seemingly) infinite number of entries. Comments on websites can work the same way.