1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2015
    Rep Power

    Lightbulb Horizontal Navbar Pulling Database Tables in PHP.....

    I'm new to learning PHP. I'm trying to build a database-driven website in which I'd like to pull tables & display the items within these tables.

    Now, I know that it seems most developers are designing their horizontal navigation bars by pulling data from their db tables to dynamically generate these navbars, but I was also wondering if it's possible to do it vice versa or if it's even something that should be considered. In other words, I already have my navbar built in CSS & HTML (populated by html <ul> & <li> structure) but I would like for the user to be able to click on the navbar & based off of the link clicked in the navbar, that will be the table that's pulled from the database & then displayed onto the main index.php page. Is this even a practical way? It seems to be backwards from some tutorials that I've seen around.
  2. #2
  3. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Washington, USA
    Rep Power
    It is a little backward, yes, but there's no reason why you couldn't do it.

    Have you written any code for this yet? Having a problem with anything specific?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2016
    Rep Power
    a database-driven website
    There's two parts to this, both of which you mentioned in your post.

    1) Dynamically producing the navigation links, so that if you add, change, or delete any of the content, the navigation will 'automatically' be up to date.

    2) When a navigation link is clicked, retrieve and display the corresponding content.

IMN logo majestic logo threadwatch logo seochat tools logo