How to code with this?

i design my website as below
+tbl_menu
-menu_id
-menu_name (news | tips| reviews )

+tbl_sub_menu
-sub_id
-menu_id
-sub_name (phone,tablet,laptop…)

+tbl_article
-art_id
-menu_name
-sub_name
-art_title

SELECT
tbl_sub_menu.sub_name,
tbl_article.menu_name,
tbl_article.art_title,
tbl_article.menu_name
FROM
tbl_sub_menu, tbl_article
WHERE
tbl_sub_menu.sub_name = tbl_article.sub_name
AND
tbl_article.menu_name = ‘tips’

how gonna code like that

SELECT
tbl_sub_menu.sub_name,
tbl_article.menu_name,
tbl_article.art_title,
tbl_article.menu_name
FROM
tbl_sub_menu, tbl_article
WHERE
tbl_sub_menu.sub_name = ‘laptop’
AND
tbl_article.menu_name = ‘tips’

so the url might look like this
example.com/index.php?menu_name=tips&sub_name=laptop
anybody give me some light?

Does a submenu item such as laptop only ever appear in one main menu?

There’s literally no point in the “tbl_” prefix, so just get rid of it.

You’ll make your database easier to read if you remove the differing names for id fields too - you’ve got menu_id as the id field for the menu table, but art_id as the id field for articles. This is going to make it harder to remember for yourself going forward.

A much better convention is to simply name your id fields as “id” in every table, and then to name foreign keys by the name of the table you’re referencing, followed by “_id”.

So the same table structure would now look like:

menus
-id
-name (news | tips| reviews )

+sub_menus
-id
-menu_id
-name (phone,tablet,laptop…)

+articles
-id
-menu_name
-sub_name
-title

I’m not sure what the “menu_name” and “sub_name” fields are for in your article table, but this database structure suddenly looks much cleaner, don’t you think?

Maybe the OP only needs one table.