Hi again!
I have a db table named "users" . Within that table, a column named "havechildren".
When a client registers on my site, they will choose whether they have children or not by a simple yes or no drop down. That information is stored in my table in the "havechldren column.
My problem is this:
I want to display different navigation links based on if "havechildren is yes or no.
Currently, all the pages inside (after login) is using a "include" menu statement referencing "menu.php" I thought about creating 2 different menus (menu1 for clients with kids and menu2 for those without). I appreciate any advice you can give me.
Thanks in advance!
cotrac

Is this a database problem?

In PHP, I might have an array of link keys whose values are each a two-part array whose keys are the values stored in the havechildren field of the database table. This gives me some nice features:

  • The array of links can be edited all in one place
  • The text associated with the links can be translated if you wish
  • The array can be generalized so that you can dispatch on things other than whether the user has children... assuming that someday you might want to add have_pets and too_rich_to_believe columns, or whatever makes sense by then.

Sorry. Posted in the wrong area. Thanks for the information. It will be very useful

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.