Jump to content


Using One Table to Select Data From Two Other Tables

  • Please log in to reply
1 reply to this topic

#1 ScrollMaster

  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 26 July 2006 - 02:28 PM

I have 3 Tables


Posts contains a message id and a user id

In order to grab the data I want do I have to make two seperate queries Post Message, Post User and then use php to match up the data or is it possible with MySQL Statements to Select all the data at once.

I am unsure how to do this.

#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 26 July 2006 - 03:39 PM

What are the "all data" that you want? Please clarify... in general, you can use JOINs and get back all the related records in a single pass.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users