Table 2: adopt_a_pet_docs (2 records)
link_id
adopt_id
title
link_url
1 1 TITLE OF LINK URL OF LINK
2 1 TITLE OF LINK2 URL OF LINK2
Problem:
The results I’m getting are this:
1 HEADING CONTENT CONTENT CONTENT
1 1 TITLE OF LINK URL OF LINK
1 HEADING CONTENT CONTENT CONTENT
2 1 TITLE OF LINK2 URL OF LINK2
2 HEADING2 CONTENT CONTENT CONTENT
3 HEADING3 CONTENT CONTENT CONTENT
4 HEADING4 CONTENT CONTENT CONTENT
5 HEADING5 CONTENT CONTENT CONTENT
I’m getting a repeat of the links when I just want the links to fall under adopt_a_pet.adopt_id 1
The MySQL I’m using:
SELECT *
FROM adopt_a_pet LEFT JOIN adopt_a_pet_docs ON adopt_a_pet.adopt_id = adopt_a_pet_docs.adopt_id
THE RESULTS I WANT:
1 HEADING CONTENT CONTENT CONTENT
1 1 TITLE OF LINK URL OF LINK
2 1 TITLE OF LINK2 URL OF LINK2
2 HEADING2 CONTENT CONTENT CONTENT
3 HEADING3 CONTENT CONTENT CONTENT
4 HEADING4 CONTENT CONTENT CONTENT
5 HEADING5 CONTENT CONTENT CONTENT
Toad78, could you please share the PHP you used to solve the problem (as you said, by “nesting the loop”)? I am having the exact same issue as you did and I’d rather not start a new thread.