It seems that you have two foreign key columns in the table bfor the table relOwner(viz Contactand ContactB).
Sverri ( ro1 ro2) (, ro2):
SELECT b.Contact, b.ContactB, ro1.OwnerID, ro1.RelationshipOwner,
ro2.OwnerID as ro2OwnerId, ro2.RelationshipOwner as ro2RelationshipOwner
FROM b
Left JOIN relOwner ro1
ON b.Contact = ro1.OwnerID
Left JOIN relOwner ro2
ON b.ContactB = ro2.OwnerID;
:
$row['ro2RelationshipOwner'];