Can someone help me in making menu in PHP and SQL?

Can someone help me in making menu in PHP and SQL?

I want to make menu like,

Menu 1, and lets its parent be Menu 2, and Menu 3 as MENU 2’s child.
How to do this with mysql.

I am totally confused, because I don’t have any idea about it.

WordPress already does it, but how to make my own one?
Please someone help…

This will get you started.

A simple example - You’d have a main menu table, and a submenu table, and you would assign the submenu items to a parent item.

The rest depends on how you fetch your data and display it!

--mainmenu

id		title
--------------
0		Hello
1		About
2		Contact


--submenu

id	assign_parent	title
--------------------------
0	1				A Happy Page
1	1				Another Page

In the above example, both submenu items would go under “About” because they are assigned a foreign key based on the mainmenu’s primary key id.