Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CraigHR's avatar

Relationships Across 4 Tables

Relationships across 4 tables.

I have Table A Table A can have something in Table B and OR table C but always a D.

D can be linked to all 3 in any of the ways below. Table D contains all 3 other tables as foreign Key links. Table C contains A and B foreign keys Table B contains A foreign key

(A->B->C->D or A->B->D or A->C->D or A->D) There’s always an A and always a D but sometimes a B and/or a C

I can use relationships to pull out everything I need EXCEPT when D doesn’t have a C. If that link breaks then a pull all “with” fails.

0 likes
0 replies

Please or to participate in this conversation.