error in multi master with same master key field name

user table as a detail table have 2 master tables: department,group
when i go touserlist.php?showmaster=group&fk_id=1 and touserlist.php?showmaster=department&fk_id=1 i see same result. i enable debug mode and see in this 2 pages this same guery:
SELECT COUNT(*) FROM userr WHERE group_id=1

i thin this error caused because of 2 master table have same primary key field name!!!

detail_table : user (fields: id,user_name,…) primary_key: id
master_table : department (fields: id,departmnet_name,…) primary_key: id
master_table : group (fields: id,group_name,…) primary_key: id

If you have the same detail key field for different master tables, the same master key value (fk_id=1) will show the same set of detail records (with different master record). There is nothing wrong with that.