hengwebdeveloper — 2012-12-01T09:19:06-05:00 — #1
i have designed my table
-menu_id(primary key with auto number)
-sub_id(primary key with auto number)
-art_id(primary key with auto number)
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?????
r937 — 2012-12-01T16:16:09-05:00 — #2
when you click on something, what language processes the action? php?
because that's where your problem is, not in mysql
hengwebdeveloper — 2012-12-01T22:12:58-05:00 — #3
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['menuid']; 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['subid']; to get the right article and error undefined index $GET['subid']; because it doesn't get any id from the menu_id so any good way to solved this????