Hey guys, I was hoping someone could help me out here again.

I've seen people pulling entries from multiple MySQL tables by using the JOIN clause, but I can't seem to get it to work with what I am trying to do.

I have 3 tables which I wish to display ALL the info from on one PHP page.
I have 3 separate PHP files which each display their corresponding MySQL tables, but I want to have ONE page which displays all of them at once by order of "date" (kind of like a "latest updates" page of some sort).

What is the easiest way I can go about doing this?

My tables are "sports", "news", and "recipes", and they all have the fields "id", "title", "date", "content".

Recommended Answers

All 2 Replies

More than likely you want the UNION operator to gather all the data together. I think you can order by date and get that effect "after" the union. Be sure to test.

Thank you so much!
I didn't even know the clause existed; I had only seen people do it by joins up until now.

It worked like a charm. Thank you again!

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.