php - Hide Repeated Column Values -


i have mysql database includes 2 tables called individuals , households. fields individuals table include:

-ind_id -first_name -middle_name -last_name -household_id 

the fields households table include:

-household_id -head_first_name -head_middle_name -head_last_name -address -city -province_state -country -postal_code -phone 

there foriegn key relationship between household_id fields in 2 tables. intent of 2 tables group individuals various households , able produce report listing selecting individuals database , group them household. isn't problem. using sql , php, have no problem producing list looks this:

-household head       address                                 phone              occupants -jones, robert john 1234 deadend st., anytown, usa 98004    (555) 420-5186     jones, ann leslie -jones, robert john 1234 deadend st., anytown, usa 98004    (555) 420-5186     jones, percy james -jones, robert john 1234 deadend st., anytown, usa 98004    (555) 420-5186     jones, robert john -smith, john george 3567 hollywood blvd., mytown, usa 97467 (308) 562-8913     smith, amanda jane -smith, john george 3567 hollywood blvd., mytown, usa 97467 (308) 562-8913     smith, john george    -smith, john george 3567 hollywood blvd., mytown, usa 97467 (308) 562-8913     smith, june anne -smith, john george 3567 hollywood blvd., mytown, usa 97467 (308) 562-8913     smith, winnifred 

i want produce list hides repeated values, same output display this:

-household head         address                             phone               occupants -jones, robert john 1234 deadend st., anytown, usa 98004    (555) 420-5186      jones, ann leslie -                                                                               jones, percy james -                                                                               jones, robert john -smith, john george 3567 hollywood blvd., mytown, usa 97467 (308) 562-8913      smith, amanda jane   -                                                                               smith, john george  -                                                                               smith, june anne -                                                                               smith, winnifred 

i still need of rows in record set, don't want them display on php page. want prevent duplicate values displaying in output. suggestions?


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -