Results 1 to 4 of 4
  1. #1

    DHTML Menu Stored from a database?

    Would a DHTML Drop down menu (Like be able to load fast enough, from a database?

    I also have a CMS that ‘simple’ users can currently easily change menu items that are stored on a database…

    In order to use one of these menus would you recommend that the menu items be moved to an include file?

    Thanks for your thoughts…

    ALSO IF SO: Is it possible to design something that edits .inc files and/or .txt files in a similar way to items stored in a database? Or would it just be fine from a database…?
    Pope Online :: Web Design

  2. #2
    yes just cache the database call..i use and ms sql 2005 so i would also set the the cache for that web part to indefinate until there are changes in the database

  3. #3
    Join Date
    Nov 2003
    Newport Beach, CA
    Kind of expensive but this will do exactly what you're describing:

    dynamic creation of menus with server-side script code (pro version only)
    Now you can insert items into the menu dynamically, from a server-side script such as ASP, PHP or ColdFusion. This is very useful if you want the menu to reflect a structure stored in a database or enable/disable items based on user's permissions. (pro only)
    I use the standard version a lot to make quick menus. works well.
    Show your reciprocal links on your website. eReferrer

  4. #4
    Join Date
    Dec 2006
    When you access a MySql database using PHP, it returns results in arrays.
    Based on my limited knowlage of DHTML, I would think that you could just do a MySql query at the top of your page to pull everything out of the database and make it equal to Variables.
    PHP Code:
    mysql_query("SELECT * FROM menuitems"); 
    $i 1;
    $row mysql_fetch_array($result))
    menu1[$i] = $row['menu1'];
    $i ++;

    //now do your dhtml menu, I found a segement of one off of a tutorial
    foreach ($menu1 as $menu1item){
    menu1[0]='<a href="
    $menu1item"> $menu1item</a>'
    This should work

Posting Permissions

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