This question has already been answered:
You need to make a request to the database in which there are many records of matches. For example, according to the parameters id_cabinet = '1' and id_staff = '1' are up to 10 identical ones, how can you leave only one and remove the redundant ones?