SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2012
    Posts
    49
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Any good way for my website

    Help.....
    i have designed my table
    tbl_menu
    --------------------------------------------
    -menu_id(primary key with auto number)
    -menu_name
    -date_created
    --------------------------------------------
    tbl_sub_menu
    --------------------------------------------
    -sub_id(primary key with auto number)
    -menu_id(foreign key)
    -sub_name
    -date_created
    --------------------------------------------
    tbl_article
    --------------------------------------------
    -art_id(primary key with auto number)
    -sub_id(foreign key)
    -art_title
    -art_detail
    --------------------------------------------

    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............

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,276
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    when you click on something, what language processes the action? php?

    because that's where your problem is, not in mysql
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2012
    Posts
    49
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •