Reputation: 526
my tables
A_ID NAME
1 apple
2 banana
3 watermelon
4 kiwi
5 peace
B_ID NAME
1 green
2 red
3 blue
4 yellow
relationship table;
A_ID | B_ID
1 2
1 3
2 4
3 1
I want to print at Php;
Upvotes: 0
Views: 47
Reputation: 163
Using the Join Query you can done it .
SELECT A.name, B.name FROM A JOIN AB ON A.id=AB.A_id JOIN B ON B.id=AB.B_id
Upvotes: 1