hey guys.

I have two MySQL tables. I'll try to keep it short :-/ Basically I'd like to join these tables, and get the data from the database. Not here's the detailed info.

I usually use the JOIN function, but this time, no join statement does the job. Neither LEFT, RIGHT, OUTER, INNER nor just JOIN works.

The first table is something similar to this:

table1; fields : ID, articleID, Detail, Links
table2; fields : ID, linkID, articleID, Link

Now, the articleID only exist once in table1, but more than once in table2. In other words, I have multiple entries in table2 with one articleID.

My problem is that when I loop/do the data in PHP, I only want to have the data listed in table1, but as well as the linkID at the same time.

So, for example, I have 7 articles in table1, and 4 links in table2, where the 4 links in table2, has the same articleID of one of the entries in table2. So instead of showing the 7 articles, it shows 7+4.

I hope you understand.

Please please help.

Thanx a million

Recommended Answers

All 2 Replies

where is you loop code and query?
also post your sample expected output

Post your table structure with sample data and share your code

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.