Any good way for my website

i have designed my table

-menu_id(primary key with auto number)


-sub_id(primary key with auto number)
-menu_id(foreign key)


-art_id(primary key with auto number)
-sub_id(foreign key)

the problem is
1- i select the tbl_menu to display menu
2- when click on the menu it will list the submenu by key of the main menu (it work perfectly)
3- but when i used the same method to display article it have problem when the page refresh it undefind index of sub_id so how is my designed where the wrong is it? any good way then it???
please help…

when you click on something, what language processes the action? php?

because that’s where your problem is, not in mysql

i use php language yeah i know it php problem.
i have connection class with destruct function at the end of class so the connection will close after finished the mysql process so i have 3 connection
1-for menu connection
echo ‘<li><a href=“showmenu.php?=menu_id”’.$resul[‘menu_id’].‘">’.$resul[‘menu_name’].‘</a></li>’;
so the menu will send 1 id to sub menu right? and the connection willl close so
2-for sub menu connection
it will get $_GET[‘menu_id’]; and fetch out the sub menu and display sub_name by menu_id it would be
echo ‘<li><a href=“submenu.php?=sub_id”’.$row[‘sub_id’].‘">’.$row[‘sub_name’].‘</a></li>’;
yeah it work perfectly
3-connection for article
when i click on sub menu it will show the article it refresh the page it will get $_GET[‘sub_id’]; to get the right article and error undefined index $_GET[‘sub_id’]; because it doesn’t get any id from the menu_id so any good way to solved this???
thank advance