I've got a problem with understanding php-mysql querying. Using this kind of query I try to print out all persons (inco\_person) with emails (inco\_phone) and phone numbers assigned to them (inco\_email).

But, what if there's more than one phone number and email address relative to one person id?

Now I get 4 rows for one person with different sets of emails and phone numbers. Is there any way, to aggregate certain fields, if there's more than one?

```
$gsf = mysqli_query( $connector2 ,"SELECT * FROM inco_person
LEFT JOIN inco_person_position ON inco_person_position.person_id=inco_person.personid
LEFT JOIN inco_position ON inco_position.positionid=inco_person_position.position_id
LEFT JOIN inco_basic ON inco_basic.basicid=inco_person_position.company_id
LEFT JOIN inco_phone ON inco_phone.pp_id=inco_person_position.ppid
LEFT JOIN inco_email ON inco_email.pp_id=inco_person_position.ppid
ORDER BY inco_person.personid") or die(mysqli_error($connector2));

```

Result:

```
ID Firstname   Lastname    Position      E-Mail       Phone

1  Jacek       Kowalski    President    68-3284099    dyrektor@abc.com

1  Jacek       Kowalski    President    661320993    j.kowalski@abc.com

1  Jacek       Kowalski    President    661320993    dyrektor@abc.com

1  Jacek       Kowalski    President    68-3284099    j.kowalski@abc.com

```