March 16th, 2017, 03:43 PM
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.
March 16th, 2017, 07:24 PM
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?
March 16th, 2017, 09:18 PM
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.