Forum Moderators: coopster

Message Too Old, No Replies

PHP Menus

filling menus from a database

         

misunderstood

8:57 am on Jun 20, 2003 (gmt 0)

10+ Year Member



Hi All,
this is my first post here so I thought I would start with a hard question. ;-)
I want to recall data from a table in a database and input this into a menu (this I have managed).
On selecting a topic in the menu I want a data list relating to this selection to show into the next menu. (that is the hard bit)
I will explain a little clearer because it is pretty complicated and a bad explaination by me.

Data from tableA FURNITURE loaded in to menu 1:
ie, tables, chairs, beds etc
on selection of beds the data from tableB finds all beds and list them into menu 2
ie, 4poster, divan, single etc

I do not know if this can be done with PHP?
or if it has to be with Javascript?
Any help would be gratefully excepted and will probably be from a genius!

hakre

11:04 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi misunderstood, welcome to webmasterworld [webmasterworld.com].

if you want an expanding menu on the user's click without reloading the page, you need to create the complete menu on page request and then show/hide submenues on layers with javascript.

if clicking on a menu entry will query a new url/page, then you won't need javascript for this.

tip: if you don't want to stress you db only for the menu and the menu isn't that big, take a look to multi dimensional arrays in php, maybe this is faster and more easy to develop and edit.

-hakre