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!

7 Years
Discussion Span
Last Post by 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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.