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
https://forums.phpfreaks.com/topic/228928-help-with-grouping-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.