无法通过此查询获得正确的开始日期和结束日期

While adding additional functionality to my search i am not able to fetch the correct start and end Date, always gives me back the first start and date of the first person in the table for every search and they should be different. (This happens while I search with department or borad), Am I doing something wrong with my query i don't know:

$query = "SELECT * 
          FROM tblperson
            JOIN members 
          WHERE ".$persondepartment." like '%".$personboard."%' 
            AND members.personid = tblperson.personid 
          GROUP BY personname;";

And this is the results i get: Start Date and End Date should be different as in the database.

1. Results: 
Name: HTC
Surname: China
Board: Evaluation
Department: Sales
Start Date: 2016-08-25 00:00:00
End Date: 2016-08-26 00:00:00

2. Results: 
Name: Ilian
Surname: Ninka
Board: Executive
Department: Sales
Start Date: 2016-08-25 00:00:00
End Date: 2016-08-26 00:00:00

Your query looks a little odd, first the group by will have a major effect on your result and is probably not what you intended.

Secondly the JOIN look like you have got a little confused.

So see if this is more like what you wanted to achieve.

$query = "SELECT * 
          FROM tblperson
             JOIN members ON members.personid = tblperson.personid 
          WHERE $persondepartment like '%$personboard%' ";