Jump to content

[SOLVED] can this be solved with a Join?


Recommended Posts

I've got two tables, table a and table b.

Table a has two fields, personA and personB.  Table b has two fields, personName and personID.  personA and personB are numbers that correspond to personID.  personName is the name associated with that ID.  It's set up this way so that different people (identified by personID) can have the same name.

 

What I need is to somehow join the two tables to get personA, personA's personName, personB, and personB's personName.  I just started looking at doing a Join, but I don't see how I could get one to work for this.  Does anyone have a good idea on how to accomplish this?  Thanks

Link to comment
https://forums.phpfreaks.com/topic/70940-solved-can-this-be-solved-with-a-join/
Share on other sites

table a keeps track of matches between two people.  There's more columns in that table, but only the IDs are important here.  I want to display the matches, and I have the IDs, now I just need to turn those IDs into names.  The IDs and Names are already stored in a separate table...table b.

it works!  I had to change it to "a.personB" and "tableA AS a", but I'm assuming those were typos.  I don't think I ever could have come up with that...so much to learn  :D.  Thanks!

 

Yeah, sorry about that, long day.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.