Skip to content
Advertisement

Duplication of results after selecting data from two tables with the same values

Good day! I’m having a problem in duplication of results when I’m selecting data from two tables with the same values. I have one data in my first table homepost with an ID of 2 and I have three data in table multiple with an ID of 2.

So. In my source code. I’m selecting all the data with the same values ID. But it duplicates my one data from homepost because I have three data from multiple with the same values [ID]. Any help? Thank you!

For example in the table below:

Results of my code:

What I want is:

Here’s my Source Code:

Advertisement

Answer

You can simply check the name each time round the loop and only output it if its a new one

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement