Most records in ispconfig have a column sys_group_id which define the group a record belongs to and each group is woned by a client. So you can get the client that owns a record by using the sys_group_id of the record that you have, then look up the client_id from sys_group table.