Jump to content

help with grouping please


khtims75

Recommended Posts

Hello,  I have a family website with an address book.  I have it set so that you can select people based on who's family they are part of.  So everyone in the family is part of my grandmother so when you select her group then everyone should display.  Then I have it so that when you select my aunt or uncle then it will display only their families and so forth.  so everyone except my grandmother has more than one family_id.  I have a master_id specific to each master_name, then each master_id can have up to 3 family_id's.  my issue is when I select all (my grandmother's group) i need it to group by my aunt's and uncle's families.  and right now it is just in order of how I entered it into the database.

 

My query selects all family_id's that = my $_POST[fam_id] from a dropdown list.  So when I select my grandmother's group it will only return family_id "1".  but i need to group by family_id 2-15, whichever is assigned to my aunt or uncle under my grandmother.  since the query does not ask for it obviously i cannot sort by it.  If I ask for everyone, grouped by family_id then I cannot select only by aunt or uncle as well.  i'm at a total loss.  please help.

 

Here is my basic query right now:

 

$sel_id= "SELECT master_id FROM master_family where family_id = '$_POST[fam_id]' ORDER BY master_id";

 

Please know this is my first website so I am very new to this and hope my question is not too lame.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.